Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Chained Ogg FLAC (Read 515 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Chained Ogg FLAC

Hi all,

I  just noticed foobar2000 is able to read chained Ogg FLAC and play back all chain links. It can even reencode a specific link. However, libFLAC doesn't support this by itself (it ignores all links but the first one) and from the most recent changelog it seems foobar2000 does in fact use libFLAC.

I'm planning to implement decoding and re-encoding of chained Ogg FLAC soon in libFLAC, so I was just wondering: how does foobar2000 get libFLAC to decode a specific chain link? Maybe this insight might give me some inspiration in how to implement this in libFLAC natively.
Music: sounds arranged such that they construct feelings.

Re: Chained Ogg FLAC

Reply #1
foobar2000 has its own Ogg demuxer, hands FLAC packets already extracted from Ogg to libFLAC. It doesn't let libFLAC read Ogg streams.
We are the bork. Your software bugs will be added to our own. Resistance is futile.

Re: Chained Ogg FLAC

Reply #2
Thanks!
Music: sounds arranged such that they construct feelings.

Re: Chained Ogg FLAC

Reply #3
I've been studying ways in which various applications use libFLAC, and it seems most implement their own Ogg demuxer. Therefore it seems a good idea to add some functionality to libFLAC to accomodate this. To me it seems it quite a bit of a hassle to get libFLAC do work properly this way, feeding it demuxed frames.

I'm thinking of adding functions to simply decode a single demuxed frame. libFLAC wasn't designed with that in mind because the FLAC format is parsed by decoding, which is very different approach from FLAC muxed in Ogg/Matroska/MP4. Perhaps I could add a few functions that enable parsing of FLAC (splitting up a FLAC stream into frames) without decoding, to enable players to split FLAC demuxing and decoding into separate steps.

Would that be something useful for foobar2000? I guess it would cut down the amount of FLAC specific code by quite a bit? Please let me know what you think.
Music: sounds arranged such that they construct feelings.

 

Re: Chained Ogg FLAC

Reply #4
I would indeed appreciate a dedicated interface for decoding single frames.
What I have now is feeding frames to libFLAC using a special reader, which is not pretty but works.
We are the bork. Your software bugs will be added to our own. Resistance is futile.