mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 08:08:22 +00:00
queue2: Fix backwards seeks into undowloaded ranges
When in download buffering mode queue2 didn't check if a range offset is in a undownloaded range before the currently in-progress range. Causing seeks to an earlier offset to, well, take a while.
This commit is contained in:
parent
280f557380
commit
0b06804735
1 changed files with 7 additions and 15 deletions
|
@ -1124,21 +1124,13 @@ gst_queue2_have_data (GstQueue2 * queue, guint64 offset, guint length)
|
||||||
guint64 threshold = 1024 * 512;
|
guint64 threshold = 1024 * 512;
|
||||||
|
|
||||||
if (QUEUE_IS_USING_RING_BUFFER (queue)) {
|
if (QUEUE_IS_USING_RING_BUFFER (queue)) {
|
||||||
guint64 distance;
|
threshold = MIN (threshold,
|
||||||
|
QUEUE_MAX_BYTES (queue) - queue->cur_level.bytes);
|
||||||
distance = QUEUE_MAX_BYTES (queue) - queue->cur_level.bytes;
|
}
|
||||||
/* don't wait for the complete buffer to fill */
|
if (offset >= queue->current->offset && offset <=
|
||||||
distance = MIN (distance, threshold);
|
queue->current->writing_pos + threshold) {
|
||||||
|
GST_INFO_OBJECT (queue,
|
||||||
if (offset >= queue->current->offset && offset <=
|
"requested data is within range, wait for data");
|
||||||
queue->current->writing_pos + distance) {
|
|
||||||
GST_INFO_OBJECT (queue,
|
|
||||||
"requested data is within range, wait for data");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
} else if (offset < queue->current->writing_pos + threshold) {
|
|
||||||
update_cur_pos (queue, queue->current, offset + length);
|
|
||||||
GST_INFO_OBJECT (queue, "wait for data");
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue