Commit 95f46c1f authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst/playback/: Refuse to change state to READY when we failed to create any of...

gst/playback/: Refuse to change state to READY when we failed to create any of the required elements in our instance ...

Original commit message from CVS:
* gst/playback/gstdecodebin.c: (gst_decode_bin_change_state):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_change_state):
Refuse to change state to READY when we failed to create any of the
required elements in our instance init function.
parent 20862a85
2006-12-16 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstdecodebin.c: (gst_decode_bin_change_state):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_change_state):
Refuse to change state to READY when we failed to create any of the
required elements in our instance init function.
2006-12-15 Tim-Philipp Müller <tim at centricular dot net>
 
* docs/libs/gst-plugins-base-libs-sections.txt:
......@@ -1655,6 +1655,11 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
decode_bin->numpads = 0;
decode_bin->numwaiting = 0;
decode_bin->dynamics = NULL;
/* catch fatal errors that may have occured in the init function */
if (decode_bin->typefind == NULL || decode_bin->fakesink == NULL) {
GST_ELEMENT_ERROR (decode_bin, CORE, MISSING_PLUGIN, (NULL), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
GST_OBJECT_LOCK (decode_bin);
......@@ -1677,6 +1682,8 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
......
......@@ -1786,6 +1786,13 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
GstDecodeBin *dbin = GST_DECODE_BIN (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
/* catch fatal errors that may have occured in the init function */
if (dbin->typefind == NULL || dbin->fakesink == NULL) {
GST_ELEMENT_ERROR (dbin, CORE, MISSING_PLUGIN, (NULL), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:{
add_fakesink (dbin);
break;
......
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