[Flac-dev] possible bug in process_metadata()

Peter Kunath research at deliplayer.com
Sun Feb 24 07:32:02 PST 2002


Hello!

I'm using the seekable stream decoder API of libFLAC 1.02
and I think that I found a possible bug in process_metadata().
The problem is as follows:
I have a file which isn't a FLAC sample (it's actually an
ACE archive) where process_metadata() returns TRUE. And even
worse, the metadataCallback() is never called (which means
process_metadata() succeeds, although no metadata is actually
processed). Is this legal? I thought that all FLAC streams
must have at least a STREAMINFO metadata block at the very
beginning. My program then fails because the channels/frequency
etc. variables arn't set (it relies on process_metadata()
calling the metadataCallback() at least once with the
STREAMINFO block).
It would be nice if someone could tell me if I'm doing
something wrong or if that's a bug in libFLAC 1.02.

BTW - stream_decoder_find_metadata() returns because this
condition is true:
else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6 sync bits */
	decoder->private_->header_warmup[1] = (FLAC__byte)x;
	decoder->protected_->state = FLAC__STREAM_DECODER_READ_FRAME;
	return true;

process_metadata() then breaks out of the while() loop because
of this condition:
	case FLAC__STREAM_DECODER_READ_FRAME:
	return true;

BTW2 - the errorCallback() is called once during process_metadata()
with status = FLAC__STREAM_DECODER_ERROR_LOST_SYNC

   - Peter.





More information about the Flac-dev mailing list