fix: skip cache warning near end of video
Low cache is expected when the video is about to end, not a sign of buffering issues.
This commit is contained in:
@@ -139,6 +139,10 @@ local function on_cache_duration(_, duration)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if duration and duration < config.cache_warning_seconds and duration > 0 then
|
if duration and duration < config.cache_warning_seconds and duration > 0 then
|
||||||
|
local time_remaining = mp.get_property_number("playtime-remaining", 999)
|
||||||
|
if time_remaining < config.cache_warning_seconds * 2 then
|
||||||
|
return
|
||||||
|
end
|
||||||
show_warning("cache", ("Low cache: %.1fs remaining"):format(duration))
|
show_warning("cache", ("Low cache: %.1fs remaining"):format(duration))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user