| 199 | } |
| 200 | |
| 201 | bool 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 | |
| 230 | void OggInputStream::_pushNextPage( ogg_page* page ) |
| 231 | { |
nothing calls this directly
no test coverage detected