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:
2025-12-07 11:44:58 +01:00
parent b25c868422
commit 256cfc5f82

View File

@@ -139,6 +139,10 @@ local function on_cache_duration(_, duration)
return
end
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))
end
end