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
This commit is contained in:
Wim Taymans 2010-02-01 11:44:34 +01:00 committed by Wim Taymans
parent 16601b09fe
commit fd755182b1

View file

@ -1173,10 +1173,18 @@ remove_decoders (GstURIDecodeBin * bin, gboolean force)
gst_element_set_state (decoder, GST_STATE_NULL); gst_element_set_state (decoder, GST_STATE_NULL);
gst_bin_remove (GST_BIN_CAST (bin), decoder); gst_bin_remove (GST_BIN_CAST (bin), decoder);
} else { } else {
GstCaps *caps;
gst_element_set_state (decoder, GST_STATE_READY); gst_element_set_state (decoder, GST_STATE_READY);
/* add it to our list of pending decodebins */ /* add it to our list of pending decodebins */
g_object_ref (decoder); g_object_ref (decoder);
gst_bin_remove (GST_BIN_CAST (bin), 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 = bin->pending_decodebins =
g_slist_prepend (bin->pending_decodebins, decoder); g_slist_prepend (bin->pending_decodebins, decoder);
} }