HI all, I have already added FLAC support to libsndfile and I am now working on adding support for OggFLAC. I have a couple of question about things that seem radically different between regular FLAC and OggFLAC. 1) FLAC has a function: FLAC__seekable_stream_decoder_get_decode_position but there seems to be no corresponding function: OggFLAC__seekable_stream_decoder_get_decode_position Why is that? 2) I have registered a metadata callback function with OggFLAC__seekable_stream_decoder_set_metadata_callback and I'm looking at the metadata struct being passed back. When using regular FLAC the field: metadata->data.stream_info.total_samples is set correctly, but with OggFLAC it seems to always be zero. Why? Can anyone shed any light? Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ " Baldie is such a wonderful villain The Linux/OSS community could not possibly ask for a better villain than our man Baldie. He is absolutely perfect for the part. Just look at his creds: 1) Physically repulsive; 2) Morally bankrupt; 3) Megalomaniacal; 4) Possessed of a truly nasty, abusive disposition; 5) Prone to Hitlerian ranting; 6) Stalinesque paranoia... The list just goes on and on. The man has the gift of true despicability, no doubt about it. If it weren't for Baldie we'd be stuck with Bilgatus' merely vacuuous and creepy persona for an anthropomorphization of the Evil Empire -- tepid at best." -- Matthew Alton in LinuxToday.com on Steve Balmer
On Tue, Oct 04, 2005 at 05:43:41AM +1000, Erik de Castro Lopo wrote:> HI all, > I have already added FLAC support to libsndfile and I am now > working on adding support for OggFLAC. I have a couple of > question about things that seem radically different between > regular FLAC and OggFLAC. > 1) FLAC has a function: > FLAC__seekable_stream_decoder_get_decode_position > but there seems to be no corresponding function: > OggFLAC__seekable_stream_decoder_get_decode_position > Why is that? > 2) I have registered a metadata callback function with > OggFLAC__seekable_stream_decoder_set_metadata_callback and > I'm looking at the metadata struct being passed back. When > using regular FLAC the field: > metadata->data.stream_info.total_samples > is set correctly, but with OggFLAC it seems to always be > zero. Why? > Can anyone shed any light?No light here, I'm afraid. But a question: will your OggFlac support be via libfishsound, or your own direct implementation in libsndfile? If you are doing this directly are you still planning to use libfishsound for OggSpeex and OggVorbis support? -- Eric Dantan Rzewnicki | Systems Administrator Technical Operations Division | Radio Free Asia 2025 M Street, NW | Washington, DC 20036 | 202-530-4900 CONFIDENTIAL COMMUNICATION This e-mail message is intended only for the use of the addressee and may contain information that is privileged and confidential. Any unauthorized dissemination, distribution, or copying is strictly prohibited. If you receive this transmission in error, please contact network@rfa.org.
--- Erik de Castro Lopo <erikd-flac@mega-nerd.com> wrote:> HI all, > > I have already added FLAC support to libsndfile and I am now > working on adding support for OggFLAC.cool.> I have a couple of > question about things that seem radically different between > regular FLAC and OggFLAC. > > 1) FLAC has a function: > > FLAC__seekable_stream_decoder_get_decode_position > > but there seems to be no corresponding function: > > OggFLAC__seekable_stream_decoder_get_decode_position > > Why is that?that function is not really possible with ogg flac because flac frames (which are in ogg packets) can be broken up into multiple pages. the reason I added that function was because of a design flaw in native FLAC, where raw frames cannot be fully extracted without decoding. for example, for taking an existing native FLAC file, extracting the frames and putting them in a matroska container, the program that does this has to decode a frame, use that function to find where it is, and know that the bytes between it and the previous call is where the frame is. but with ogg flac that can span a page boundary so you can't extract the frame that way. best to use an ogg decoder to recover pages, then packets. then you don't even need to decode the flac frames. unless there is another reason you need that kind of functionality? (p.s. this might also help: http://flac.sourceforge.net/ogg_mapping.html)> 2) I have registered a metadata callback function with > OggFLAC__seekable_stream_decoder_set_metadata_callback and > I'm looking at the metadata struct being passed back. When > using regular FLAC the field: > > metadata->data.stream_info.total_samples > > is set correctly, but with OggFLAC it seems to always be > zero. Why? > > Can anyone shed any light?normally the flac encoder goes back to fill in missing STREAMINFO fields after encoding is finished. the encoder may not know total_samples when encoding starts; if not it has to go back and put it in at the end of encoding. even when encoding to ogg flac as of flac-1.1.2 it should do that. so either: - the ogg flac file was encoded with flac-1.1.1 or earlier - the ogg flac file was encoded to stdout so the writeback couldn't happen (flac --ogg file.wav > file.flac) - there is a bug somewhere! Josh __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
--- Josh Coalson <xflac@yahoo.com> wrote:> --- Erik de Castro Lopo <erikd-flac@mega-nerd.com> wrote: > > 2) I have registered a metadata callback function with > > OggFLAC__seekable_stream_decoder_set_metadata_callback and > > I'm looking at the metadata struct being passed back. When > > using regular FLAC the field: > > > > metadata->data.stream_info.total_samples > > > > is set correctly, but with OggFLAC it seems to always be > > zero. Why? > > > > Can anyone shed any light? > > normally the flac encoder goes back to fill in missing STREAMINFO > fields after encoding is finished. the encoder may not know > total_samples when encoding starts; if not it has to go back and > put it in at the end of encoding. even when encoding to ogg flac > as of flac-1.1.2 it should do that. so either: > > - the ogg flac file was encoded with flac-1.1.1 or earlier > - the ogg flac file was encoded to stdout so the writeback couldn't > happen (flac --ogg file.wav > file.flac) > - there is a bug somewhere!was going through old mail... there is a bug in 1.1.2 where this data is not rewritten back to ogg flac for any reason (same is true for seek points). this has been fixed and will be in 1.1.3. Josh ____________________________________________________________________________________ Sponsored Link Compare mortgage rates for today. Get up to 5 free quotes. Www2.nextag.com