MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _read_func

Method _read_func

Engine/source/sfx/media/sfxVorbisStream.cpp:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81size_t SFXVorbisStream::_read_func( void *ptr, size_t size, size_t nmemb, void *datasource )
82{
83 Stream *stream = reinterpret_cast<Stream*>( datasource );
84
85 // Stream::read() returns true if any data was
86 // read, so we must track the read bytes ourselves.
87 U32 startByte = stream->getPosition();
88 stream->read( size * nmemb, ptr );
89 U32 endByte = stream->getPosition();
90
91 // How many did we actually read?
92 U32 readBytes = ( endByte - startByte );
93 U32 readItems = readBytes / size;
94
95 return readItems;
96}
97
98S32 SFXVorbisStream::_seek_func( void *datasource, ogg_int64_t offset, S32 whence )
99{

Callers

nothing calls this directly

Calls 2

getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected