mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
Update the buffering state before stalling for more data
In some cases the wait for more data was happening without updating the buffering state, meaning the API user would not be able to notice it should pause the pipeline and update UI to indicate that is the case, the video would likely stutter instead. https://bugzilla.gnome.org/show_bug.cgi?id=707648
This commit is contained in:
parent
3dc8ee97e5
commit
4cb596ddd6
1 changed files with 9 additions and 0 deletions
|
@ -255,6 +255,7 @@ static gboolean gst_queue2_is_empty (GstQueue2 * queue);
|
|||
static gboolean gst_queue2_is_filled (GstQueue2 * queue);
|
||||
|
||||
static void update_cur_level (GstQueue2 * queue, GstQueue2Range * range);
|
||||
static void update_in_rates (GstQueue2 * queue);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -875,6 +876,10 @@ update_buffering (GstQueue2 * queue)
|
|||
gint percent;
|
||||
gboolean post = FALSE;
|
||||
|
||||
/* Ensure the variables used to calculate buffering state are up-to-date. */
|
||||
update_cur_level (queue, queue->current);
|
||||
update_in_rates (queue);
|
||||
|
||||
if (!get_buffering_percent (queue, NULL, &percent))
|
||||
return;
|
||||
|
||||
|
@ -1285,6 +1290,10 @@ gst_queue2_create_read (GstQueue2 * queue, guint64 offset, guint length,
|
|||
update_cur_pos (queue, queue->current, rpos);
|
||||
GST_QUEUE2_SIGNAL_DEL (queue);
|
||||
}
|
||||
|
||||
if (queue->use_buffering)
|
||||
update_buffering (queue);
|
||||
|
||||
GST_DEBUG_OBJECT (queue, "waiting for add");
|
||||
GST_QUEUE2_WAIT_ADD_CHECK (queue, queue->srcresult, out_flushing);
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue