diff --git a/ChangeLog b/ChangeLog index 5fa5389d8e..182893c330 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-10-09 Ronald S. Bultje + + * 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 * gst/playback/gstplaybin.c: (gst_play_bin_class_init), diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 9fb48ee85c..d8d40e089b 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -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; } diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index 145dd20697..6183bf613f 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -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: