diff options
Diffstat (limited to 'gst/autodetect/gstautoaudiosrc.c')
-rw-r--r-- | gst/autodetect/gstautoaudiosrc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/autodetect/gstautoaudiosrc.c b/gst/autodetect/gstautoaudiosrc.c index 8e23490a..8d352c55 100644 --- a/gst/autodetect/gstautoaudiosrc.c +++ b/gst/autodetect/gstautoaudiosrc.c @@ -362,7 +362,9 @@ gst_auto_audio_src_detect (GstAutoAudioSrc * 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 audio source"); @@ -375,6 +377,13 @@ no_src: ("Failed to find a supported audio 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 |