From 2da1bb25384b93b02725bf5df0c452de2ca026bd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 14 Dec 2007 09:24:55 +0000 Subject: [PATCH] gst/playback/gstqueue2.c: Pause the timer to measure the input rate when we block because the queue is filled. See #5... Original commit message from CVS: * gst/playback/gstqueue2.c: (gst_queue_chain): Pause the timer to measure the input rate when we block because the queue is filled. See #503262. --- ChangeLog | 6 ++++++ gst/playback/gstqueue2.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index d876f83e6a..71314162e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-14 Wim Taymans + + * gst/playback/gstqueue2.c: (gst_queue_chain): + Pause the timer to measure the input rate when we block because the + queue is filled. See #503262. + 2007-12-13 Wim Taymans Patch by: Peter Kjellerstedt diff --git a/gst/playback/gstqueue2.c b/gst/playback/gstqueue2.c index 41d261efdb..ca5b4a5df4 100644 --- a/gst/playback/gstqueue2.c +++ b/gst/playback/gstqueue2.c @@ -1292,10 +1292,21 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer) /* We make space available if we're "full" according to whatever * the user defined as "full". */ while (gst_queue_is_filled (queue)) { + gboolean started; + + /* pause the timer while we wait. The fact that we are waiting does not mean + * the byterate on the input pad is lower */ + if ((started = queue->timer_started)) + g_timer_stop (queue->timer); + GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "queue is full, waiting for free space"); /* Wait for space to be available, we could be unlocked because of a flush. */ GST_QUEUE_WAIT_DEL_CHECK (queue, out_flushing); + + /* and continue if we were running before */ + if (started) + g_timer_continue (queue->timer); } /* put buffer in queue now */