diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-19 20:31:01 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-19 20:31:01 +0100 |
commit | 600a8102367359b58bc16bb8def59cdd78139221 (patch) | |
tree | bbeb2507a2140df1c9f29001bfd163bdf3e597b2 | |
parent | 20468a22c94726c93a9771dff9e0d0c2f07a9a76 (diff) |
decodebin2: recover from failing to add a pad
When we cannot add a pad to the decodebin2 for some reason, print a warning but
continue adding the remaining pads.
-rw-r--r-- | gst/playback/gstdecodebin2.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 0544c19d3..45876afd7 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2130,12 +2130,10 @@ gst_decode_group_expose (GstDecodeGroup * group) GST_LOG ("Exposing group %p", group); - /* re-order pads : video, then audio, then others */ group->endpads = g_list_sort (group->endpads, (GCompareFunc) sort_end_pads); /* Expose pads */ - for (tmp = group->endpads; tmp; tmp = next) { GstDecodePad *dpad = (GstDecodePad *) tmp->data; gchar *padname; @@ -2151,9 +2149,11 @@ gst_decode_group_expose (GstDecodeGroup * group) g_free (padname); /* 2. activate and add */ - if (!gst_element_add_pad (GST_ELEMENT (dbin), GST_PAD (dpad))) - goto name_problem; - + if (!gst_element_add_pad (GST_ELEMENT (dbin), GST_PAD (dpad))) { + /* not really fatal, we can try to add the other pads */ + g_warning ("error adding pad to decodebin2"); + continue; + } dpad->added = TRUE; /* 3. emit signal */ @@ -2162,7 +2162,6 @@ gst_decode_group_expose (GstDecodeGroup * group) gst_decode_bin_signals[SIGNAL_NEW_DECODED_PAD], 0, dpad, (next == NULL)); GST_DEBUG_OBJECT (dbin, "emitted new-decoded-pad"); - } /* signal no-more-pads. This allows the application to hook stuff to the @@ -2198,12 +2197,6 @@ gst_decode_group_expose (GstDecodeGroup * group) GST_LOG_OBJECT (dbin, "Group %p exposed", group); return TRUE; - -name_problem: - { - g_warning ("error adding pad to decodebin2"); - return FALSE; - } } /* must be called with the decodebin lock */ |