mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
20862a8523
commit
95f46c1fee
3 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue