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 624266 - [playbin2] Internal uridecodebin are not properly removed in READY=>NULL
[playbin2] Internal uridecodebin are not properly removed in READY=>NULL
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.30
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-13 16:46 UTC by Edward Hervey
Modified: 2010-07-14 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstplaybin2: Remove uridecodebin when going to NULL. (1.42 KB, patch)
2010-07-13 16:48 UTC, Edward Hervey
needs-work Details | Review
Log of failure (626.86 KB, text/plain)
2010-07-14 08:17 UTC, Edward Hervey
  Details
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state (1.99 KB, patch)
2010-07-14 11:00 UTC, Sebastian Dröge (slomo)
none Details | Review
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state (2.06 KB, patch)
2010-07-14 11:02 UTC, Sebastian Dröge (slomo)
none Details | Review
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state (1.71 KB, patch)
2010-07-14 11:57 UTC, Sebastian Dröge (slomo)
none Details | Review
playbin2: Disconnect and destroy uridecodebins when going from READY to NULL (2.42 KB, patch)
2010-07-14 13:02 UTC, Sebastian Dröge (slomo)
none Details | Review
playbin2: Disconnect and destroy uridecodebins when going from READY to NULL (3.95 KB, patch)
2010-07-14 13:11 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Edward Hervey 2010-07-13 16:46:41 UTC
When one re-uses playbin2 after having it set it to NULL, playbin2 will end up still having the previously used uridecodebin since they are not removed from playbin2 in READY=>NULL.

This error will cause (amongst other things) this issue:
* you play some files/streams in totem
* one of them has an error
 * totem sets playbin2 to NULL
* user clicks on the next stream
 * totem sets playbin2 to PAUSED/PLAYING
  * previous (erroring) uridecodebin will be set to PAUSED/PLAYING and you will get the errors again.

The following patch fixes the issue.
Comment 1 Edward Hervey 2010-07-13 16:48:44 UTC
Created attachment 165817 [details] [review]
gstplaybin2: Remove uridecodebin when going to NULL.

If you re-use playbin2... you will end-up with the previous
uridecodebin(s) still present and wanting to change state.
Comment 2 Sebastian Dröge (slomo) 2010-07-13 18:49:57 UTC
This patch is not entirely correct. The uridecodebins will usually be removed from the bin already, which gives you an assertion failure.

e.g. in activate_group() if the suburidecodebin fails and in deactivate_group() (which is called on state change failures and when switching groups).

At least you should check if the parent of the uridecodebins still is playbin2 before removing them.


Now the real question is, why the old, failed uridecodebins are not removed from the bin for you.

Of course the idea of the patch is correct and the uridecodebins should be removed from playbin2 in the state change function when going to NULL but something is really wrong if the broken uridecodebins are still inside the bin at that point.
Comment 3 Sebastian Dröge (slomo) 2010-07-13 18:56:41 UTC
Also I can't reproduce this here... which totem version are you using?
Comment 4 Edward Hervey 2010-07-13 19:13:34 UTC
totem 2.30.0 (not sure it's the same at on my office computer, but it definitely shows the same mis-behaviour).
Comment 5 Edward Hervey 2010-07-13 19:14:34 UTC
it should be noted also that I get the following critical warning :
(totem:6109): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed

Which comes from the notify::source callback which tries to get the source... from a NULL uridecodebin.
Comment 6 Tim-Philipp Müller 2010-07-14 08:00:18 UTC
Are you sure you are using current git of -base? Because this looks exactly like the issue I had and which got fixed, see bug #505770 comment 21 and bug #623318.
Comment 7 Edward Hervey 2010-07-14 08:15:37 UTC
This happens only when the error is triggered by the demuxer before any streams are created.

And yes, I'm certain it's current git of -base
Comment 8 Edward Hervey 2010-07-14 08:17:35 UTC
Created attachment 165848 [details]
Log of failure

GST_DEBUG=2,totem:5,*STATE*:5,playbin2:5,uridecodebin:5 totem /media/data/medias/animal\ 2006\ movie.mov /media/data/medias/07\ Steria\ -\ Logo.avi > log 2>&1

The first file will fail in qtdemux (it's always failed, that's not the issue here) and totem shows me an error.
When I click next I get the same error.

This is with totem 2.30.2
Comment 9 Sebastian Dröge (slomo) 2010-07-14 11:00:45 UTC
Created attachment 165866 [details] [review]
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state

Fixes spurious errors that happen after an error and playing a working
stream afterwards or signals that are emitted for non-active groups.

Fixes bug #624266.
Comment 10 Sebastian Dröge (slomo) 2010-07-14 11:02:22 UTC
Created attachment 165867 [details] [review]
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state

Fixes spurious errors that happen after an error and playing a working
stream afterwards or signals that are emitted for non-active groups.

Fixes bug #624266.
Comment 11 Sebastian Dröge (slomo) 2010-07-14 11:03:27 UTC
Still has some problems it seems... it deadlocks :( Will look later
Comment 12 Sebastian Dröge (slomo) 2010-07-14 11:57:57 UTC
Created attachment 165870 [details] [review]
playbin2: Disconnect uridecodebins when going back to READY and set them to NULL state

Fixes spurious errors that happen after an error and playing a working
stream afterwards or signals that are emitted for non-active groups.

Fixes bug #624266.
Comment 13 Sebastian Dröge (slomo) 2010-07-14 13:02:10 UTC
Created attachment 165876 [details] [review]
playbin2: Disconnect and destroy uridecodebins when going from READY to NULL

Fixes spurious errors that happen after an error and playing a working
stream afterwards or signals that are emitted for non-active groups.

Fixes bug #624266.
Comment 14 Sebastian Dröge (slomo) 2010-07-14 13:11:25 UTC
Created attachment 165877 [details] [review]
playbin2: Disconnect and destroy uridecodebins when going from READY to NULL

Fixes spurious errors that happen after an error and playing a working
stream afterwards or signals that are emitted for non-active groups.

Fixes bug #624266.
Comment 15 Edward Hervey 2010-07-14 13:26:18 UTC
Last patch fixes the issue without any hangs. Nice one :)
Comment 16 Sebastian Dröge (slomo) 2010-07-14 13:37:02 UTC
commit 8bd37ab9956d390a867d99196fe9d363c11dd679
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Jul 14 12:59:19 2010 +0200

    playbin2: Disconnect and destroy uridecodebins when going from READY to NULL
    
    Fixes spurious errors that happen after an error and playing a working
    stream afterwards or signals that are emitted for non-active groups.
    
    Fixes bug #624266.