summaryrefslogtreecommitdiff
path: root/gst/autodetect/gstautoaudiosink.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/autodetect/gstautoaudiosink.c')
-rw-r--r--gst/autodetect/gstautoaudiosink.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/autodetect/gstautoaudiosink.c b/gst/autodetect/gstautoaudiosink.c
index e3785390..4ed1ba9e 100644
--- a/gst/autodetect/gstautoaudiosink.c
+++ b/gst/autodetect/gstautoaudiosink.c
@@ -361,7 +361,9 @@ gst_auto_audio_sink_detect (GstAutoAudioSink * sink)
/* attach ghost pad */
GST_DEBUG_OBJECT (sink, "Re-assigning ghostpad");
targetpad = gst_element_get_static_pad (sink->kid, "sink");
- gst_ghost_pad_set_target (GST_GHOST_PAD (sink->pad), targetpad);
+ if (!gst_ghost_pad_set_target (GST_GHOST_PAD (sink->pad), targetpad))
+ goto target_failed;
+
gst_object_unref (targetpad);
GST_DEBUG_OBJECT (sink, "done changing auto audio sink");
@@ -374,6 +376,13 @@ no_sink:
("Failed to find a supported audio sink"));
return FALSE;
}
+target_failed:
+ {
+ GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL),
+ ("Failed to set target pad"));
+ gst_object_unref (targetpad);
+ return FALSE;
+ }
}
static GstStateChangeReturn