gst/playback/gstplaybasebin.c: Thread safety.
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sun, 16 Jan 2005 14:38:40 +0000 (14:38 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sun, 16 Jan 2005 14:38:40 +0000 (14:38 +0000)
Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (probe_triggered):
Thread safety.

ChangeLog
gst/playback/gstplaybasebin.c

index a4a90203135a7a304117447ec5e596f4884731be..44e330014c04320d46e4c6476c7808e58a850074 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-16  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * gst/playback/gstplaybasebin.c: (probe_triggered):
+         Thread safety.
+
 2005-01-16  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * ext/swfdec/gstswfdec.c: (gst_swfdec_change_state):
index 48b112db569b749ea143498d6b7d71460880b846..7f72d65b8e607b617e62b8dc163e3b100f22a2c7 100644 (file)
@@ -656,8 +656,15 @@ 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);