gst/playback/gstplaybasebin.c: Actually clean up streaminfo if output fails. This would trigger if, for example, ther...

Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (setup_source),
(gst_play_base_bin_change_state):
Actually clean up streaminfo if output fails. This would trigger
if, for example, there was no CD in the drive. No preroll, so
a streaminfo structure is created, but the subsequent state change
of the thread fails.
* gst/playback/gstplaybin.c: (gst_play_bin_change_state):
Don't change state if parent failed.
This commit is contained in:
Ronald S. Bultje 2004-10-09 13:50:33 +00:00
parent 002a5ec2b6
commit c82f67606c
3 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,14 @@
2004-10-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybasebin.c: (setup_source),
(gst_play_base_bin_change_state):
Actually clean up streaminfo if output fails. This would trigger
if, for example, there was no CD in the drive. No preroll, so
a streaminfo structure is created, but the subsequent state change
of the thread fails.
* gst/playback/gstplaybin.c: (gst_play_bin_change_state):
Don't change state if parent failed.
2004-10-08 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybin.c: (gst_play_bin_class_init),

View file

@ -403,6 +403,10 @@ setup_source (GstPlayBaseBin * play_base_bin)
gst_bin_remove (GST_BIN (play_base_bin->thread), old_src);
}
gst_bin_add (GST_BIN (play_base_bin->thread), play_base_bin->source);
if (gst_bin_sync_children_state (GST_BIN (play_base_bin->thread)) ==
GST_STATE_FAILURE) {
return FALSE;
}
}
/* now see if the source element emits raw audio/video all by itself,
@ -670,6 +674,12 @@ gst_play_base_bin_change_state (GstElement * element)
* because one stream was unrecognized. */
g_signal_connect (play_base_bin->thread, "error",
G_CALLBACK (gst_play_base_bin_error), play_base_bin);
} else {
/* in case of no preroll, we might have streaminfo already... */
g_list_foreach (play_base_bin->streaminfo,
(GFunc) g_object_unref, NULL);
g_list_free (play_base_bin->streaminfo);
play_base_bin->streaminfo = NULL;
}
break;
}

View file

@ -527,6 +527,8 @@ gst_play_bin_change_state (GstElement * element)
transition = GST_STATE_TRANSITION (element);
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element);
if (ret == GST_STATE_FAILURE)
return ret;
switch (transition) {
case GST_STATE_NULL_TO_READY: