gst/playback/gstplaybasebin.c: Avoid crash when there are external subtitles (fixes...
authorTim-Philipp Müller <tim@centricular.net>
Tue, 6 Nov 2007 11:09:30 +0000 (11:09 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 6 Nov 2007 11:09:30 +0000 (11:09 +0000)
Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (queue_threshold_reached),
(finish_source):
Avoid crash when there are external subtitles (fixes #491722).

ChangeLog
common
gst/playback/gstplaybasebin.c

index 05070b9089798ee3313335de92ff7e4c1ffe1d24..55fee5d32dfec6cddfa740b07838bf9dfabb0053 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-06  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/playback/gstplaybasebin.c: (queue_threshold_reached),
+         (finish_source):
+         Avoid crash when there are external subtitles (fixes #491722).
+
 2007-11-03  Tim-Philipp Müller  <tim at centricular dot net>
 
        * ext/alsa/gstalsasink.c: (gst_alsasink_open):
diff --git a/common b/common
index 34d7d649b972ea4915611a6ed88f01613bf32777..423e2ea96b5f79281f4dd20d734bd968b3d95e89 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 34d7d649b972ea4915611a6ed88f01613bf32777
+Subproject commit 423e2ea96b5f79281f4dd20d734bd968b3d95e89
index 5c3a1115e9fd36f5abde3ef55024eca367b8b252..cc308ba22dd611a14ec00a3904cbec40cb162bca 100644 (file)
@@ -671,9 +671,15 @@ queue_threshold_reached (GstElement * queue, GstPlayBaseBin * play_base_bin)
         play_base_bin->queue_min_threshold, NULL);
   }
 
+  GROUP_LOCK (play_base_bin);
+  group = get_active_group (play_base_bin);
+  if (!group) {
+    GROUP_UNLOCK (play_base_bin);
+    return;
+  }
+
   /* we remove the probe now because we don't need it anymore to give progress
    * about the buffering. */
-  group = get_active_group (play_base_bin);
   for (n = 0; n < NUM_TYPES; n++) {
     GstElement *element = group->type[n].preroll;
 
@@ -683,6 +689,8 @@ queue_threshold_reached (GstElement * queue, GstPlayBaseBin * play_base_bin)
     queue_remove_probe (element, play_base_bin);
   }
 
+  GROUP_UNLOCK (play_base_bin);
+
   /* we post a 100% buffering message to notify the app that buffering is
    * completed and playback can start/continue */
   if (play_base_bin->is_stream)
@@ -2205,6 +2213,7 @@ could_not_link:
 static void
 finish_source (GstPlayBaseBin * play_base_bin)
 {
+  /* FIXME: no need to grab the group lock here? (tpm) */
   if (get_active_group (play_base_bin) != NULL) {
     if (play_base_bin->subtitle) {
       /* make subs iterate from now on */