diff --git a/ChangeLog b/ChangeLog index 44e330014c..d1050082d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-16 Ronald S. Bultje + + * gst/playback/gstplaybasebin.c: (probe_triggered): + Of course, only pause if group is done... + 2005-01-16 Ronald S. Bultje * gst/playback/gstplaybasebin.c: (probe_triggered): diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 7f72d65b8e..fd76660575 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -648,6 +648,19 @@ probe_triggered (GstProbe * probe, GstData ** data, gpointer user_data) } if (have_left) { + g_mutex_lock (play_base_bin->group_lock); + while (g_list_length (play_base_bin->queued_groups) < 2 && + GST_STATE (play_base_bin->thread) == GST_STATE_PLAYING) { + GST_DEBUG ("Waiting for new groups"); + g_cond_wait (play_base_bin->group_cond, play_base_bin->group_lock); + GST_DEBUG ("done"); + } + g_mutex_unlock (play_base_bin->group_lock); + + /* error? */ + if (GST_STATE (play_base_bin->thread) != GST_STATE_PLAYING) + return TRUE; + GST_DEBUG ("changing state for group change"); gst_element_set_state (play_base_bin->thread, GST_STATE_PAUSED); /* ok, get rid of the current group then */ @@ -656,15 +669,8 @@ probe_triggered (GstProbe * probe, GstData ** data, gpointer user_data) gst_play_base_bin_signals[GROUP_SWITCH_SIGNAL], 0); /* removing the current group brings the next group * active */ - g_mutex_lock (play_base_bin->group_lock); play_base_bin->queued_groups = g_list_remove (play_base_bin->queued_groups, group); - while (!play_base_bin->queued_groups) { - GST_DEBUG ("Waiting for new groups"); - g_cond_wait (play_base_bin->group_cond, play_base_bin->group_lock); - GST_DEBUG ("done"); - } - g_mutex_unlock (play_base_bin->group_lock); setup_substreams (play_base_bin); GST_DEBUG ("switching to next group %p", play_base_bin->queued_groups->data);