Commit 98d290b8 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

ext/gconf/: Fix state change functions here as well and set kid to NULL state before removing it.

Original commit message from CVS:
* ext/gconf/gstgconfaudiosink.c: (do_toggle_element),
(gst_gconf_audio_sink_change_state):
* ext/gconf/gstgconfvideosink.c: (do_toggle_element),
(gst_gconf_video_sink_change_state):
Fix state change functions here as well and set kid
to NULL state before removing it.
parent 4ab30e55
2005-11-02 Tim-Philipp Müller <tim at centricular dot net>
* ext/gconf/gstgconfaudiosink.c: (do_toggle_element),
(gst_gconf_audio_sink_change_state):
* ext/gconf/gstgconfvideosink.c: (do_toggle_element),
(gst_gconf_video_sink_change_state):
Fix state change functions here as well and set kid
to NULL state before removing it.
2005-11-01 Edward Hervey <edward@fluendo.com>
* gst/wavenc/gstwavenc.c: (gst_wavenc_stop_file),
......
......@@ -122,6 +122,7 @@ do_toggle_element (GstGConfAudioSink * sink)
/* kill old element */
if (sink->kid) {
GST_DEBUG_OBJECT (sink, "Removing old kid");
gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
sink->kid = NULL;
}
......@@ -156,6 +157,7 @@ static GstStateChangeReturn
gst_gconf_audio_sink_change_state (GstElement * element,
GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstGConfAudioSink *sink = GST_GCONF_AUDIO_SINK (element);
switch (transition) {
......@@ -163,6 +165,14 @@ gst_gconf_audio_sink_change_state (GstElement * element,
if (!do_toggle_element (sink))
return GST_STATE_CHANGE_FAILURE;
break;
default:
break;
}
ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
(element, transition), GST_STATE_CHANGE_SUCCESS);
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
gst_gconf_audio_sink_reset (sink);
break;
......@@ -170,6 +180,5 @@ gst_gconf_audio_sink_change_state (GstElement * element,
break;
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
(element, transition), GST_STATE_CHANGE_SUCCESS);
return ret;
}
......@@ -122,6 +122,7 @@ do_toggle_element (GstGConfVideoSink * sink)
/* kill old element */
if (sink->kid) {
GST_DEBUG_OBJECT (sink, "Removing old kid");
gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
sink->kid = NULL;
}
......@@ -156,6 +157,7 @@ static GstStateChangeReturn
gst_gconf_video_sink_change_state (GstElement * element,
GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstGConfVideoSink *sink = GST_GCONF_VIDEO_SINK (element);
switch (transition) {
......@@ -163,6 +165,14 @@ gst_gconf_video_sink_change_state (GstElement * element,
if (!do_toggle_element (sink))
return GST_STATE_CHANGE_FAILURE;
break;
default:
break;
}
ret = GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
(element, transition), GST_STATE_CHANGE_SUCCESS);
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
gst_gconf_video_sink_reset (sink);
break;
......@@ -170,6 +180,5 @@ gst_gconf_video_sink_change_state (GstElement * element,
break;
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
(element, transition), GST_STATE_CHANGE_SUCCESS);
return ret;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment