Josh et al, I've been tracking down a problem with generating OggFlac files. While investigatint this issue I hacked one of the test files from the test_libFLAC directory of the flac-1.1.3-beta2. The result of this hacking is this standalone C file: http://www.mega-nerd.com/tmp/erikd_test.c Directions for compiling this is in the comments at the top of the file. When the program is run, it generates 4 files: seekable.flac stream.flac seekable.ogg stream.ogg The problem is that the two OggFlac files are lacking an end-of-stream marker. For instance, the ogginfo program says: erikd@mingus > ogginfo stream.ogg Processing file "stream.ogg"... New logical stream (#1, serial: 00003039): type unknown Warning: EOS not set on stream 1 erikd@mingus > ogginfo seekable.ogg Processing file "seekable.ogg"... New logical stream (#1, serial: 00003039): type unknown Warning: EOS not set on stream 1 I have looked into this and suspect that the FLAC__stream_encoder_finish() function needs to finish off the stream using a call to ogg_stream_flush() instead of the standard function ogg_stream_pageout(). Josh (or anyone), I'd appreciate it if you could take a look at this. Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "life is too long to be an expert at harmful things, including such evilness as C++ and perl." -- Erik Naggum
Erik de Castro Lopo
2006-Nov-03 22:24 UTC
[PATCH] Re: [Flac-dev] Strangeness with OggFlac files
Erik de Castro Lopo wrote:> Josh et al, > > I've been tracking down a problem with generating OggFlac files.<snip>> I have looked into this and suspect that the FLAC__stream_encoder_finish() > function needs to finish off the stream using a call to ogg_stream_flush() > instead of the standard function ogg_stream_pageout().I bashed on this a bit further and came up with the following patch: http://www.mega-nerd.com/tmp/flac-end_of_stream.diff There's probably a more tasteful way of acheiving the same result, but this version does fix the problem. Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "Capitalism is an art form, an Apollonian fabrication to rival nature. It is hypocritical for feminists and intellectuals to enjoy the pleasures and conveniences of capitalism while sneering at it. Everyone born into capitalism has incurred a debt to it." -- Camille Paglia
--- Erik de Castro Lopo <erikd-flac@mega-nerd.com> wrote:> Erik de Castro Lopo wrote: > > > Josh et al, > > > > I've been tracking down a problem with generating OggFlac files. > > <snip> > > > I have looked into this and suspect that the > FLAC__stream_encoder_finish() > > function needs to finish off the stream using a call to > ogg_stream_flush() > > instead of the standard function ogg_stream_pageout(). > > I bashed on this a bit further and came up with the following patch: > > http://www.mega-nerd.com/tmp/flac-end_of_stream.diff > > There's probably a more tasteful way of acheiving the same result, > but > this version does fix the problem.thanks Erik, can you confirm that this is happening only because the total_samples_estimate is 0? (so the e_o_s setting in the existing code is never triggered). Josh ____________________________________________________________________________________ Sponsored Link Degrees online in as fast as 1 Yr - MBA, Bachelor's, Master's, Associate Click now to apply http://yahoo.degrees.info