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 655268 - decodebin2: deadlock after multi-stream chains change
decodebin2: deadlock after multi-stream chains change
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-25 14:54 UTC by Philip Jägenstedt
Modified: 2011-10-29 15:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file to reproduce (377.91 KB, video/ogg)
2011-07-25 14:55 UTC, Philip Jägenstedt
Details

Description Philip Jägenstedt 2011-07-25 14:54:00 UTC
This commit introduced a deadlock:

commit c91928f7a2461aba57f64e014f507bcb62d7adc6
Author: Edward Hervey <edward.hervey@collabora.co.uk>
Date:   Mon Jul 25 10:41:04 2011 +0200

    decodebin2: Properly handle multi-stream chains
    
    When we have a multi-stream (i.e. audio and video) input and the demuxer
    adds/removes pads for a new stream (common in a mpeg-ts stream when the
    program stream mapping is updated), the algorithm for EOS handling was
    previously wrong (it would only drop the EOS of the *last* pad but would
    let the EOS on the other pads go through).
    
    The logic has only been changed a tiny bit for EOS handling resulting in:
    * If there is no next group, let the EOS go through
    * If there is a next group, but not all pads are drained in the active
      group, drop the EOS event
    * If there is a next group and all pads are drained, then the ghostpads
      will be removed and the EOS event will be dropped automatically.

All I need to reproduce the deadlock is this <video> test case:

<video src="svt2-44100Hz.ogv" controls></video>
<script>
var v = document.querySelector('video');
v.onsuspend = function() {
  v.currentTime = v.duration;
};
v.preload = "auto";
</script>

What this does is to simply seek to the end of the file once it is has stopped loading. Seeking to somewhere other than the end does not reproduce the issue. You need an Ogg file with both audio and video to reproduce and it helps if it's fairly small. It will deadlock when leaving the page, as Opera is stuck in a gst_element_get_state call that never returns. Full backtrace:


Comment 1 Philip Jägenstedt 2011-07-25 14:55:06 UTC
Created attachment 192617 [details]
file to reproduce
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-25 18:00:07 UTC
It also break the tests:
gst-plugins-base/tests/check$ make elements/playbin2-compressed.check
is hanging for me.
Comment 3 Edward Hervey 2011-07-26 10:36:13 UTC
Philip, can you try again with git master. It contains a (stupid) fix for the test failure that Stefan mentionned.

commit 38a6919a7bb36b4db340ec783cf95afc1410cadf
Author: Edward Hervey <edward.hervey@collabora.co.uk>
Date:   Tue Jul 26 12:33:56 2011 +0200

    decodebin2: Allow all EOS to go through if we don't have a next group
    
    Only drop them if the current group isn't drained .. AND there is a
    next group to switch to.
    
    Should Fix #655268
Comment 4 Philip Jägenstedt 2011-07-26 13:00:51 UTC
I can confirm that it's fixed by commit commit 38a6919a7bb36b4db340ec783cf95afc1410cadf