gst/playback/gstplaybasebin.c: Stop buffering when the group is commited because...
authorWim Taymans <wim.taymans@gmail.com>
Tue, 29 May 2007 13:38:35 +0000 (13:38 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 29 May 2007 13:38:35 +0000 (13:38 +0000)
Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (queue_overrun),
(no_more_pads_full):
Stop buffering when the group is commited because the queues filled up.
Fixes #442024.

ChangeLog
gst/playback/gstplaybasebin.c

index 6b8be9d..033eacf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-29  Wim Taymans  <wim@fluendo.com>
+
+       * gst/playback/gstplaybasebin.c: (queue_overrun),
+       (no_more_pads_full):
+       Stop buffering when the group is commited because the queues filled up.
+       Fixes #442024.
+
 2007-05-25  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_ensure_track_list),
index 32743f0..bcb7fc8 100644 (file)
@@ -597,25 +597,6 @@ queue_deadlock_check (GstElement * queue, GstPlayBaseBin * play_base_bin)
   }
 }
 
-/* this signal will be fired when one of the queues with raw
- * data is filled. This means that the group building stage is over 
- * and playback of the new queued group should start. This is a rather unusual
- * situation because normally the group is commited when the "no_more_pads"
- * signal is fired.
- */
-static void
-queue_overrun (GstElement * queue, GstPlayBaseBin * play_base_bin)
-{
-  GST_DEBUG_OBJECT (play_base_bin, "queue %s overrun",
-      GST_ELEMENT_NAME (queue));
-
-  preroll_remove_overrun (queue, play_base_bin);
-
-  group_commit (play_base_bin, FALSE,
-      GST_OBJECT_PARENT (GST_OBJECT_CAST (queue)) ==
-      GST_OBJECT_CAST (play_base_bin->subtitle));
-}
-
 /* Used for time-based buffering in streaming mode and is called when a queue
  * emits the running signal. This means that the high watermark threshold is
  * reached and the buffering is completed. */
@@ -667,6 +648,28 @@ queue_threshold_reached (GstElement * queue, GstPlayBaseBin * play_base_bin)
   fill_buffer (play_base_bin, 100);
 }
 
+/* this signal will be fired when one of the queues with raw
+ * data is filled. This means that the group building stage is over 
+ * and playback of the new queued group should start. This is a rather unusual
+ * situation because normally the group is commited when the "no_more_pads"
+ * signal is fired.
+ */
+static void
+queue_overrun (GstElement * queue, GstPlayBaseBin * play_base_bin)
+{
+  GST_DEBUG_OBJECT (play_base_bin, "queue %s overrun",
+      GST_ELEMENT_NAME (queue));
+
+  preroll_remove_overrun (queue, play_base_bin);
+
+  group_commit (play_base_bin, FALSE,
+      GST_OBJECT_PARENT (GST_OBJECT_CAST (queue)) ==
+      GST_OBJECT_CAST (play_base_bin->subtitle));
+
+  /* notify end of buffering */
+  queue_threshold_reached (queue, play_base_bin);
+}
+
 /* this signal is only added when in streaming mode to catch underruns
  */
 static void
@@ -1048,6 +1051,8 @@ no_more_pads_full (GstElement * element, gboolean subs,
   if (!g_object_get_data (G_OBJECT (element), "pending"))
     return;
 
+  GST_DEBUG_OBJECT (element, "remove pending");
+
   g_object_set_data (G_OBJECT (element), "pending", NULL);
 
   play_base_bin->pending--;