diff options
Diffstat (limited to 'gst/autodetect/gstautovideosrc.c')
-rw-r--r-- | gst/autodetect/gstautovideosrc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/autodetect/gstautovideosrc.c b/gst/autodetect/gstautovideosrc.c index d542178e..1de2160b 100644 --- a/gst/autodetect/gstautovideosrc.c +++ b/gst/autodetect/gstautovideosrc.c @@ -353,7 +353,9 @@ gst_auto_video_src_detect (GstAutoVideoSrc * src) /* attach ghost pad */ GST_DEBUG_OBJECT (src, "Re-assigning ghostpad"); targetpad = gst_element_get_static_pad (src->kid, "src"); - gst_ghost_pad_set_target (GST_GHOST_PAD (src->pad), targetpad); + if (!gst_ghost_pad_set_target (GST_GHOST_PAD (src->pad), targetpad)) + goto target_failed; + gst_object_unref (targetpad); GST_DEBUG_OBJECT (src, "done changing auto video source"); @@ -366,6 +368,13 @@ no_src: ("Failed to find a supported video source")); return FALSE; } +target_failed: + { + GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL), + ("Failed to set target pad")); + gst_object_unref (targetpad); + return FALSE; + } } static GstStateChangeReturn |