GNOME Bugzilla – Bug 729315
oggmux: Transcoding short vorbis file fails
Last modified: 2014-06-22 13:01:34 UTC
8 second 440 Hz sine wave with 44.1 kHz sample rate, generated by Audacity The simple pipeline hangs forever with the attached ogg file: $ gst-launch-1.0 filesrc location=sine.ogg ! decodebin ! vorbisenc ! oggmux ! filesink location=output.ogg Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Redistribute latency... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock The input ogg file is an 8 second 440 Hz sine wave with 44.1 kHz sample rate that was generated by Audacity. For some reason End-of-Stream is never reached.
Created attachment 275523 [details] 8 second 440 Hz sine wave with 44.1 kHz sample rate, generated by Audacity
Confirmed! I checked with other ogg files and the same happens, with the above recoding pipeline EOS is never reached. But when playing the ogg files there is an End. Will look into why this is happening.
Problem does not happen when filesrc is an mp3 file.
After the pipeline is rolling for a few seconds we get: 0:00:02.787916276 19349 0x7f7b080560f0 INFO task gsttask.c:301:gst_task_func:<oggdemux0:sink> Task going to paused
Problem isn't in oggmux.
Well, unless the issue isn't a regression. Which I am starting to incline towards since it happens as well when running the 1.2.3 release. Will confirm with an older release tomorrow.
Might be in collectpads then. But it's probably something around oggmux, as oggmux gets the EOS event but never outputs it again.
Thanks Sebastian! Looking into it right now.
Created attachment 276005 [details] [review] fix Now the 8 second ogg file transcodes correctly and the pipeline closes at EOS. Have also tested oggmux with other sources.
The problem was that gst_ogg_mux_queue_pads() was returning NULL, which means EOS as commented in that function. But the check for best == NULL would just return a GST_FLOW_ERROR and not send the EOS event up.
Comment on attachment 276005 [details] [review] fix Why didn't it post an error if GST_FLOW_ERROR was returned? That should be fixed too I guess. Otherwise, this looks good.
Created attachment 276021 [details] [review] better fix Handle the best->buffer with: g_return_val_if_fail (best->buffer != NULL, GST_FLOW_ERROR);
The following fix has been pushed: 43ae5a1 oggmux: push eos event when empty pad data
Created attachment 276022 [details] [review] oggmux: push eos event when empty pad data If gst_ogg_mux_queue_pads returns NULL it means we are at EOS, because we get a NULL buffer and this function never sets bestpad.