After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729315 - oggmux: Transcoding short vorbis file fails
oggmux: Transcoding short vorbis file fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal critical
: 1.3.2
Assigned To: Luis de Bethencourt
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-01 08:26 UTC by Stefan Hajnoczi
Modified: 2014-06-22 13:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
8 second 440 Hz sine wave with 44.1 kHz sample rate, generated by Audacity (16.37 KB, audio/ogg)
2014-05-01 08:27 UTC, Stefan Hajnoczi
  Details
fix (1.41 KB, patch)
2014-05-06 17:03 UTC, Luis de Bethencourt
accepted-commit_now Details | Review
better fix (1.49 KB, patch)
2014-05-06 20:19 UTC, Luis de Bethencourt
committed Details | Review
oggmux: push eos event when empty pad data (1.49 KB, patch)
2014-05-06 20:27 UTC, Luis de Bethencourt
committed Details | Review

Description Stefan Hajnoczi 2014-05-01 08:26:58 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.
Comment 1 Stefan Hajnoczi 2014-05-01 08:27:45 UTC
Created attachment 275523 [details]
8 second 440 Hz sine wave with 44.1 kHz sample rate, generated by Audacity
Comment 2 Luis de Bethencourt 2014-05-01 14:44:18 UTC
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.
Comment 3 Luis de Bethencourt 2014-05-01 14:47:32 UTC
Problem does not happen when filesrc is an mp3 file.
Comment 4 Luis de Bethencourt 2014-05-01 14:50:59 UTC
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
Comment 5 Luis de Bethencourt 2014-05-06 03:30:01 UTC
Problem isn't in oggmux.
Comment 6 Luis de Bethencourt 2014-05-06 03:35:09 UTC
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.
Comment 7 Sebastian Dröge (slomo) 2014-05-06 07:06:58 UTC
Might be in collectpads then. But it's probably something around oggmux, as oggmux gets the EOS event but never outputs it again.
Comment 8 Luis de Bethencourt 2014-05-06 13:44:40 UTC
Thanks Sebastian!

Looking into it right now.
Comment 9 Luis de Bethencourt 2014-05-06 17:03:08 UTC
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.
Comment 10 Luis de Bethencourt 2014-05-06 17:04:52 UTC
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 11 Sebastian Dröge (slomo) 2014-05-06 17:08:05 UTC
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.
Comment 12 Luis de Bethencourt 2014-05-06 20:19:32 UTC
Created attachment 276021 [details] [review]
better fix

Handle the best->buffer with:

g_return_val_if_fail (best->buffer != NULL, GST_FLOW_ERROR);
Comment 13 Luis de Bethencourt 2014-05-06 20:26:58 UTC
The following fix has been pushed:
43ae5a1 oggmux: push eos event when empty pad data
Comment 14 Luis de Bethencourt 2014-05-06 20:27:05 UTC
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.