mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
multiqueue: make sure percent increases
Keep track of the last posted percent message and make sure the next percent messages are strictly increasing.
This commit is contained in:
parent
30fc865162
commit
b852da60d4
2 changed files with 11 additions and 1 deletions
|
@ -731,7 +731,6 @@ update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
|
|||
tmp = (size.bytes * 100) / sq->max_size.bytes;
|
||||
percent = MAX (percent, tmp);
|
||||
}
|
||||
percent = MIN (percent, 100);
|
||||
}
|
||||
|
||||
if (mq->buffering) {
|
||||
|
@ -739,9 +738,19 @@ update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
|
|||
if (percent >= mq->high_percent) {
|
||||
mq->buffering = FALSE;
|
||||
}
|
||||
/* make sure it increases */
|
||||
percent = MAX (mq->percent, percent);
|
||||
|
||||
if (percent == mq->percent)
|
||||
/* don't post if nothing changed */
|
||||
post = FALSE;
|
||||
else
|
||||
/* else keep last value we posted */
|
||||
mq->percent = percent;
|
||||
} else {
|
||||
if (percent < mq->low_percent) {
|
||||
mq->buffering = TRUE;
|
||||
mq->percent = percent;
|
||||
post = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ struct _GstMultiQueue {
|
|||
gboolean use_buffering;
|
||||
gint low_percent, high_percent;
|
||||
gboolean buffering;
|
||||
gint percent;
|
||||
|
||||
guint32 counter; /* incoming object counter, protected with STREAM_LOCK */
|
||||
guint32 highid; /* contains highest id of last outputted object */
|
||||
|
|
Loading…
Reference in a new issue