diff options
Diffstat (limited to 'ext/gconf/gstgconfvideosink.c')
-rw-r--r-- | ext/gconf/gstgconfvideosink.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/gconf/gstgconfvideosink.c b/ext/gconf/gstgconfvideosink.c index e22791db..1e7c16e6 100644 --- a/ext/gconf/gstgconfvideosink.c +++ b/ext/gconf/gstgconfvideosink.c @@ -70,7 +70,7 @@ gst_gconf_video_sink_class_init (GstGConfVideoSinkClass * klass) * Hack to make negotiation work. */ -static void +static gboolean gst_gconf_video_sink_reset (GstGConfVideoSink * sink) { GstPad *targetpad; @@ -81,6 +81,10 @@ gst_gconf_video_sink_reset (GstGConfVideoSink * sink) gst_bin_remove (GST_BIN (sink), sink->kid); } sink->kid = gst_element_factory_make ("fakesink", "testsink"); + if (!sink->kid) { + GST_ERROR_OBJECT (sink, "Failed to create fakesink"); + return FALSE; + } gst_bin_add (GST_BIN (sink), sink->kid); targetpad = gst_element_get_pad (sink->kid, "sink"); @@ -89,6 +93,8 @@ gst_gconf_video_sink_reset (GstGConfVideoSink * sink) g_free (sink->gconf_str); sink->gconf_str = NULL; + + return TRUE; } static void @@ -223,7 +229,8 @@ gst_gconf_video_sink_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: - gst_gconf_video_sink_reset (sink); + if (!gst_gconf_video_sink_reset (sink)) + ret = GST_STATE_CHANGE_FAILURE; break; default: break; |