// At this point we should have found the seekpoint closest to our sample. If we are seeking forward and the closest seekpoint is _before_ the current sample, we
while(seekpointsRemaining>0){
// just seek forward from where we are. Otherwise we start seeking from the seekpoint's first sample.
isLastBlock=DRFLAC_TRUE;// An error occured while seeking. Attempt to recover by treating this as the last block which will in turn terminate the loop.
isLastBlock=DRFLAC_TRUE;// An error occured while seeking. Attempt to recover by treating this as the last block which will in turn terminate the loop.
isLastBlock=DRFLAC_TRUE;// An error occured while seeking. Attempt to recover by treating this as the last block which will in turn terminate the loop.
isLastBlock=DRFLAC_TRUE;// An error occured while seeking. Attempt to recover by treating this as the last block which will in turn terminate the loop.
// The Ogg bistream needs to be layered on top of the original bitstream.
// The Ogg bistream needs to be layered on top of the original bitstream.
pFlac->bs.onRead=drflac__on_read_ogg;
pFlac->bs.onRead=drflac__on_read_ogg;
pFlac->bs.onSeek=drflac__on_seek_ogg;
pFlac->bs.onSeek=drflac__on_seek_ogg;
pFlac->bs.pUserData=(void*)oggbs;
pFlac->bs.pUserData=(void*)pInternalOggbs;
pFlac->_oggbs=(void*)oggbs;
pFlac->_oggbs=(void*)pInternalOggbs;
}
}
#endif
#endif
// Decode metadata before returning.
pFlac->firstFramePos=firstFramePos;
if(init.hasMetadataBlocks){
if(!drflac__read_and_decode_metadata(pFlac)){
// NOTE: Seektables are not currently compatible with Ogg encapsulation (Ogg has it's own accelerated seeking system). I may change this later, so I'm leaving this here for now.
DRFLAC_FREE(pFlac);
#ifndef DR_FLAC_NO_OGG
returnNULL;
if(init.container==drflac_container_ogg)
{
pFlac->pSeekpoints=NULL;
pFlac->seekpointCount=0;
}
else
#endif
{
// If we have a seektable we need to load it now, making sure we move back to where we were previously.