From fd755182b17f381254058cf747d287b1a8a03ea6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 1 Feb 2010 11:44:34 +0100 Subject: [PATCH] uridecodebin: clean up decodebin properties When reusing a decodebin2 element, clear the properties we might have changed, to their default values or else we might end up with old configuration. Fixes #608484 --- gst/playback/gsturidecodebin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index b45e4bf0f5..0b28738273 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -1173,10 +1173,18 @@ remove_decoders (GstURIDecodeBin * bin, gboolean force) gst_element_set_state (decoder, GST_STATE_NULL); gst_bin_remove (GST_BIN_CAST (bin), decoder); } else { + GstCaps *caps; + gst_element_set_state (decoder, GST_STATE_READY); /* add it to our list of pending decodebins */ g_object_ref (decoder); gst_bin_remove (GST_BIN_CAST (bin), decoder); + /* restore some properties we might have changed */ + g_object_set (G_OBJECT (decoder), "sink-caps", NULL, NULL); + caps = DEFAULT_CAPS; + g_object_set (G_OBJECT (decoder), "caps", caps, NULL); + gst_caps_unref (caps); + bin->pending_decodebins = g_slist_prepend (bin->pending_decodebins, decoder); }