demux: fix seek ranges of images

When a video-reconfig occurs with an image, the cache is not used
because find_cache_seek_range() checks if the start time was
initialized, but for images it stays at MP_NOPTS_VALUE. This makes
rotating large network images slow because they are re-downloaded on
every rotation.

Fix this by setting the timestamps of image cache ranges by altering a
condition.
This commit is contained in:
Guido Cella 2024-04-01 18:22:16 +02:00 committed by sfan5
parent 6179995dd7
commit 8d85627aad
1 changed files with 1 additions and 1 deletions

View File

@ -663,7 +663,7 @@ static void update_seek_ranges(struct demux_cached_range *range)
}
}
if (range->seek_start >= range->seek_end)
if (range->seek_start >= range->seek_end && !(range->is_bof && range->is_eof))
goto broken;
prune_metadata(range);