This commit is contained in:
2026-08-15 17:50:48 +02:00
parent 22246060e6
commit 4dc6687de7
35 changed files with 4978 additions and 1509 deletions
+8 -1
View File
@@ -5,6 +5,11 @@
local msg = require "mp.msg"
local function is_protocol(path)
return type(path) == 'string' and (path:find('^%a[%w.+-]-://') ~= nil or path:find('^%a[%w.+-]-:%?') ~= nil)
end
local function fix_avsync()
local paused = mp.get_property_bool("pause")
msg.info("fix A/V sync.")
@@ -19,7 +24,9 @@ end
mp.observe_property("current-ao", "native", function(_, device)
local aid = mp.get_property_number("aid")
local has_af = mp.get_property("af", "") ~= ""
if device and aid and has_af then
local path = mp.get_property("path")
local time = mp.get_property_native("time-pos")
if device and aid and has_af and time > 0 and not is_protocol(path) then
fix_avsync()
end
end)