fix: removed leftover ending uncached range on some streams

The end time of the last cached range on fully buffered video is sometimes lower than reported duration, which was causing a redundant uncached range indicator at the end of the timeline.

ref #214
This commit is contained in:
tomasklaen
2022-09-19 15:00:49 +02:00
parent c8f4f22d15
commit 08d4dd9e4d

View File

@@ -4164,7 +4164,9 @@ mp.observe_property('demuxer-cache-state', 'native', function(prop, cache_state)
else
if last_uncached[2] > cached[1] then last_uncached[2] = cached[1] end
end
uncached_ranges[#uncached_ranges + 1] = {cached[2], state.duration}
if state.duration - cached[2] > 0.5 then
uncached_ranges[#uncached_ranges + 1] = {cached[2], state.duration}
end
end
end
end