mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
don't lock when min-threshold and max-size conflict.
When min-threshold is set on a queue, it is possible that one of the minima remains unsatisfied while one of the maxima is already reached. Therefore, always consider the queue non-empty if it is full. Fixes #585433.
This commit is contained in:
parent
d881bf69d1
commit
34aeb8ba7e
1 changed files with 9 additions and 6 deletions
|
@ -825,13 +825,16 @@ out_eos:
|
|||
static gboolean
|
||||
gst_queue_is_empty (GstQueue * queue)
|
||||
{
|
||||
/* It is possible that a max size is reached before all min thresholds are.
|
||||
* Therefore, only consider it empty if it is not filled. */
|
||||
return (queue->queue->length == 0 ||
|
||||
(queue->min_threshold.buffers > 0 &&
|
||||
queue->cur_level.buffers < queue->min_threshold.buffers) ||
|
||||
(queue->min_threshold.bytes > 0 &&
|
||||
queue->cur_level.bytes < queue->min_threshold.bytes) ||
|
||||
(queue->min_threshold.time > 0 &&
|
||||
queue->cur_level.time < queue->min_threshold.time));
|
||||
((queue->min_threshold.buffers > 0 &&
|
||||
queue->cur_level.buffers < queue->min_threshold.buffers) ||
|
||||
(queue->min_threshold.bytes > 0 &&
|
||||
queue->cur_level.bytes < queue->min_threshold.bytes) ||
|
||||
(queue->min_threshold.time > 0 &&
|
||||
queue->cur_level.time < queue->min_threshold.time)) &&
|
||||
!gst_queue_is_filled (queue));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue