From 600a8102367359b58bc16bb8def59cdd78139221 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 19 Mar 2009 20:31:01 +0100 Subject: [PATCH] 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. --- gst/playback/gstdecodebin2.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 0544c19..45876af 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 */ -- 2.7.4