[Flac-dev] possible bug in process_metadata()

Josh Coalson xflac at yahoo.com
Tue Feb 26 21:22:03 PST 2002


--- Peter Kunath <research at deliplayer.com> wrote:
> On Sun, 24 Feb 2002 15:31:42 +0100, you wrote:
> 
> >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?
> 
> Addition: today, I've scanned my HD for more of these
> problematic files and I found alot of them:(( Especially
> ACE archives cause this error, but also certain Baldur's
> Gate & Diablo2 save files(:-)) and even BMP files! What
> puzzles me is that none of these files has a 'fLaC'
> signature at the beginng. Doesn't libFLAC test this ID?

nope, it assumes that you've already determined that it's
a FLAC stream.

let me try and clear this up.  it's not clear in the docs,
which I need to fix, but the 'fLaC' magic number and metadata
blocks are really only required for file storage.  at the
stream level, a FLAC stream will still play without them.

when you interface to libFLAC at the stream level you are
implicitly asserting that you know it's a FLAC stream.
when you interface at the file level, you are also asserting
that the file contains the magic number and at least the
STREAMINFO block.

if you try and decode something for which these are not true,
you should always get an error callback.  if you keep going,
say on a file that has FLAC frames but missing the STREAMINFO,
the decoder will resync and give you data.

does that help?

Josh


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com




More information about the Flac-dev mailing list