GNOME Bugzilla – Bug 583750
Crash when playing with decodebin2 in pipeline.
Last modified: 2009-05-27 16:17:29 UTC
Steps to reproduce: Try to run the code below. On third track you will get warning or crash. import gobject gobject.threads_init() import gst class Player(): def __init__(self): self.player = gst.Pipeline("player") source = gst.element_factory_make("filesrc", "filesrc") decoder = gst.element_factory_make("decodebin2", "decodebin2") conv = gst.element_factory_make("audioconvert", "converter") volume = gst.element_factory_make("volume", "volume") sink = gst.element_factory_make("autoaudiosink", "alsa-output") self.player.add(source, decoder, conv, volume, sink) gst.element_link_many(source, decoder) gst.element_link_many(conv, volume, sink) def new_decode_pad(dbin, pad, islast): pad.link(conv.get_pad("sink")) decoder.connect("new-decoded-pad", new_decode_pad) def play_track(self, track): self.player.set_state(gst.STATE_NULL) self.player.get_by_name("filesrc").set_property("location", track) self.player.set_state(gst.STATE_PLAYING) from time import sleep p = Player() p.play_track('track1.mp3') sleep(3) p.play_track('track2.mp3') sleep(3) p.play_track('track3.mp3') sleep(10) Stack trace: Warning: invalid uninstantiatable type `(null)' in cast to `GObject' self.player.set_state(gst.STATE_PLAYING) Warning: g_object_notify: assertion `G_IS_OBJECT (object)' failed self.player.set_state(gst.STATE_PLAYING) Other information: This happens only if using decodebin2.
Same results with decodebin.
This seems to fix things for decodebin2. I could however not find why exactly it was crashing. commit 650215bcfda5c7ca6ec6d14f7442c7b32f94f636 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed May 27 18:12:10 2009 +0200 decodebin2: remove leftover elements Remove all of the elements inside decodebin2 when goint to READY and NULL. Makes decodebin2 reusable. Fixes #583750