[Flac-dev] How to handle multiple STREAMINFO blocks?

Brian Willoughby brianw at sounds.wa.com
Tue Nov 16 01:59:25 PST 2010

It's certainly best to honor what the specification says.  My  
assumption is that a "stream" could also be a continuous broadcast,  
not just a file.  With a hypothetical server streaming FLAC  
bitstreams, I would assume that the most recent STREAMINFO is valid  
until another one comes along.  If you're writing a file player, then  
perhaps you can trust the spec and assume that there will never be  
more than one.  But I suppose it all depends upon which is easier to  
handle in your code.  Some implementations might make it more  
complicated to ignore spurious STREAMINFO blocks.  I'd say do  
whatever is easiest, and bank on files not having more than one anyway.

Brian Willoughby
Sound Consulting

On Nov 16, 2010, at 00:00, Lorenzo wrote:
> As far as I know one and only one STREAMINFO should be present at  
> the beginning of the file: http://flac.sourceforge.net/format.html
> "A FLAC bitstream consists of the "fLaC" marker at the beginning of  
> the stream, followed by a mandatory metadata block (called the  
> STREAMINFO block), any number of other metadata blocks, then the  
> audio frames."
> 2010/11/16 Brian Waters <brianmwaters at gmail.com>
>> I'm writing a program that plays FLAC files using the libFLAC API's.
>> Is there a specific way I'm supposed to handle multiple STREAMINFO
>> metadata blocks?
>> For example, should I ignore all but the first, or all but the last?
>> The format spec doesn't mention anything.

More information about the Flac-dev mailing list