+2005-10-04 Michael Smith <msmith@fluendo.com>
+
+ * gst/autodetect/gstautoaudiosink.c: (gst_auto_audio_sink_reset),
+ (gst_auto_audio_sink_find_best), (gst_auto_audio_sink_detect):
+ * gst/autodetect/gstautovideosink.c: (gst_auto_video_sink_reset),
+ (gst_auto_video_sink_find_best), (gst_auto_video_sink_detect):
+ Set state of elements to NULL before removing from bins.
+ Set state of test element to NULL if we failed to move it to READY
+
2005-10-04 Edward Hervey <edward@fluendo.com>
* ext/dv/Makefile.am:
/* fakesink placeholder */
if (sink->kid) {
+ gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
}
sink->kid = gst_element_factory_make ("fakesink", "tempsink");
GST_LOG ("This worked!");
choice = el;
goto done;
+ } else {
+ gst_element_set_state (el, GST_STATE_NULL);
}
}
GstPad *targetpad;
if (sink->kid) {
+ gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
sink->kid = NULL;
}
/* fakesink placeholder */
if (sink->kid) {
+ gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
}
sink->kid = gst_element_factory_make ("fakesink", "tempsink");
GST_DEBUG_OBJECT (sink, "Trying %s", GST_PLUGIN_FEATURE (f)->name);
if ((el = gst_element_factory_create (f, "actual-sink"))) {
+ GstStateChangeReturn ret;
+
GST_DEBUG_OBJECT (sink, "Changing state to READY");
- if (gst_element_set_state (el,
- GST_STATE_READY) == GST_STATE_CHANGE_SUCCESS) {
+
+ ret = gst_element_set_state (el, GST_STATE_READY);
+ if (ret == GST_STATE_CHANGE_SUCCESS) {
GST_DEBUG_OBJECT (sink, "success");
return el;
}
+ GST_WARNING_OBJECT (sink, "Couldn't set READY: %d", ret);
+ ret = gst_element_set_state (el, GST_STATE_NULL);
+ if (ret != GST_STATE_CHANGE_SUCCESS)
+ GST_WARNING_OBJECT (sink,
+ "Couldn't set element to NULL prior to disposal.");
+
gst_object_unref (GST_OBJECT (el));
}
}
GstPad *targetpad;
if (sink->kid) {
+ gst_element_set_state (sink->kid, GST_STATE_NULL);
gst_bin_remove (GST_BIN (sink), sink->kid);
sink->kid = NULL;
}