[Flac] When to terminate decoding process ?

Lars von Wedel vonwedel at web.de
Thu Jan 20 05:20:21 PST 2005


Hello,

my FLAC plugin to VDR is now running, but the decoder runs into an 
endless loop at the end of the song.
Usually, blocks of 4608 samples are decoded, the last block only has 
2220, so I assume this is really the end of the file:

Samples decoded: 2220, current time: 292290, bits per sample: 16

Obtaining the decoder states after decoding this last block still looks 
like decoding should go on. Instead, I had expected to receive a 
FLAC__FILE_DECODER_END_OF_FILE 
<http://flac.sourceforge.net/api/group__flac__file__decoder.html#a36a5> 
when calling  FLAC::Decoder::File 
<http://flac.sourceforge.net/api/classFLAC_1_1Decoder_1_1File.html>::get_state(). 
Instead I obtain this:

Status of decoder: FLAC__FILE_DECODER_OK
Status of seekable stream decoder: FLAC__SEEKABLE_STREAM_DECODER_OK
Status of stream decoder: FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC

I have no idea, what to use as a termination criterion for my loop 
around process_single. Any ideas?

Lars




More information about the Flac mailing list