GNOME Bugzilla – Bug 337111
flacenc output is incompatible with flacdec
Last modified: 2006-04-08 14:05:20 UTC
A flac file created with the pipeline: alsasrc device=default ! audioconvert ! flacenc ! filesink location=test.flac Is unplayable with the pipeline: filesrc location=test.flac ! decodebin ! audioconvert ! alsasink device=default The decodebin recognises it as flac and initializes flacdec without any problems, but immediately after all elements reaching the play state they appear to reach the end of the stream and shutdown. The created file (test.flac) is playable in xine and recognised as flac, and the described output pipeline works with flac files produced by other flac encoders.
This seems to be the same problem as bug #337609 and should be fixed in gst-plugins-good CVS now. The problem is that if you use the above pipeline and then interrupt it with control-C the pipeline isn't stopped in a controlled way (so that an EOS is sent). Without that, flacenc doesn't write the actual number of samples written into the flac stream header, so the stream header contains total_samples = 0 (="don't know"), which flacdec didn't handle correctly until then. A better way to do this with gst-launch would be: alsasrc device=default num-buffers=256 ! audioconvert ! flacenc ! filesink location=test.flac That will shut the pipeline down cleanly and make flacenc fill in the header. If you need to shut down a pipeline like this programmatically from your own code you can do this as well without specifying the number of buffers in advance, see the GstBaseSrc online documentation for details on how to do that. *** This bug has been marked as a duplicate of 337609 ***