+2008-01-08 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/playback/gstdecodebin.c: (try_to_link_1):
+ Make sure we error out correctly if we can't activate one of
+ the elements we've added. Fixes #508138.
+
2008-01-07 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Bastien Nocera <hadess at hadess net>
gst_bin_add (GST_BIN (decode_bin), element);
/* set to READY first so it is ready, duh. */
- gst_element_set_state (element, GST_STATE_READY);
+ if (gst_element_set_state (element,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) {
+ GST_WARNING_OBJECT (decode_bin, "Couldn't set %s to READY",
+ GST_ELEMENT_NAME (element));
+ /* get rid of the sinkpad */
+ gst_object_unref (sinkpad);
+ /* this element did not work, remove it again and continue trying
+ * other elements, the element will be disposed. */
+ /* FIXME: shouldn't we do this before adding it to the bin so that no
+ * error messages get through to the app? (tpm) */
+ gst_bin_remove (GST_BIN (decode_bin), element);
+ continue;
+ }
if ((ret = gst_pad_link (usedsrcpad, sinkpad)) != GST_PAD_LINK_OK) {
GST_DEBUG_OBJECT (decode_bin, "link failed on pad %s:%s, reason %d",
/* now that we added the element we can try to continue autoplugging
* on it until we have a raw type */
close_link (element, decode_bin);
+
/* change the state of the element to that of the parent */
- gst_element_set_state (element, GST_STATE_PAUSED);
+ if ((gst_element_set_state (element,
+ GST_STATE_PAUSED)) == GST_STATE_CHANGE_FAILURE) {
+ GST_WARNING_OBJECT (decode_bin, "Couldn't set %s to PAUSED",
+ GST_ELEMENT_NAME (element));
+ gst_element_set_state (element, GST_STATE_NULL);
+ gst_bin_remove (GST_BIN (decode_bin), element);
+ continue;
+ }
result = element;