From 8d85627aad4a8e98db19aec7e4e28ca61b1bbe25 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 1 Apr 2024 18:22:16 +0200 Subject: [PATCH] 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. --- demux/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demux/demux.c b/demux/demux.c index 386b088148..9aa63bc18c 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -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);