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

Method _pullNextPage

Engine/source/core/ogg/oggInputStream.cpp:201–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201bool OggInputStream::_pullNextPage( ogg_page* page)
202{
203 // Read another page.
204
205 while( ogg_sync_pageout( &mOggSyncState, page ) != 1 )
206 {
207 enum { BUFFER_SIZE = 4096 };
208
209 // Read more data.
210
211 char* buffer = ogg_sync_buffer( &mOggSyncState, BUFFER_SIZE );
212 const U32 oldPos = mStream->getPosition();
213 mStream->read( BUFFER_SIZE, buffer );
214
215 const U32 numBytes = mStream->getPosition() - oldPos;
216 if( numBytes )
217 ogg_sync_wrote( &mOggSyncState, numBytes );
218 else
219 return false;
220 }
221
222 #ifdef DEBUG_SPEW
223 Platform::outputDebugString( "[OggInputStream] pulled next page (header: %i, body: %i)",
224 page->header_len, page->body_len );
225 #endif
226
227 return true;
228}
229
230void OggInputStream::_pushNextPage( ogg_page* page )
231{

Callers

nothing calls this directly

Calls 5

ogg_sync_pageoutFunction · 0.85
ogg_sync_bufferFunction · 0.85
ogg_sync_wroteFunction · 0.85
getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected