From 5deb6e096daf302c08e06ebe50455dfc3b66beec Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 May 2007 13:38:35 +0000 Subject: [PATCH] gst/playback/gstplaybasebin.c: Stop buffering when the group is commited because the queues filled up. 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 | 7 +++++++ gst/playback/gstplaybasebin.c | 43 ++++++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b8be9d..033eacf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-29 Wim Taymans + + * 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 * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_ensure_track_list), diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 32743f0..bcb7fc8 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -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--; -- 2.7.4