This commit is contained in:
2026-03-25 00:56:58 -07:00
parent 96f327e4dc
commit c31402c8f1
5 changed files with 89 additions and 12 deletions

View File

@@ -396,6 +396,9 @@ M._reset_uosc_input_state = function(reason)
return false
end
pcall(mp.commandv, 'script-message-to', 'uosc', 'close-menu')
pcall(mp.commandv, 'script-message-to', 'uosc', 'sync-cursor')
M._disable_input_section('input_console', why .. '@immediate')
M._disable_input_section('input_forced_console', why .. '@immediate')
mp.add_timeout(0.05, function()
if ensure_uosc_loaded() then
pcall(mp.commandv, 'script-message-to', 'uosc', 'sync-cursor')
@@ -403,6 +406,13 @@ M._reset_uosc_input_state = function(reason)
M._disable_input_section('input_console', why .. '@sync')
M._disable_input_section('input_forced_console', why .. '@sync')
end)
mp.add_timeout(0.20, function()
if ensure_uosc_loaded() then
pcall(mp.commandv, 'script-message-to', 'uosc', 'sync-cursor')
end
M._disable_input_section('input_console', why .. '@sync2')
M._disable_input_section('input_forced_console', why .. '@sync2')
end)
return true
end
@@ -1332,9 +1342,10 @@ local function attempt_start_pipeline_helper_async(callback)
end
-- Wait for helper to become ready in background (non-blocking).
-- 12 s gives Python time to kill a stale lock holder (PS scan + taskkill)
-- and publish its first ready heartbeat before we give up.
local deadline = mp.get_time() + 12.0
-- The Python helper can spend up to 12s recovering a stale singleton lock
-- before it even starts connecting to mpv IPC, so the Lua-side wait must be
-- comfortably longer than that to avoid false startup failures.
local deadline = mp.get_time() + 45.0
local timer
timer = mp.add_periodic_timer(0.1, function()
if _is_pipeline_helper_ready() then
@@ -1345,7 +1356,7 @@ local function attempt_start_pipeline_helper_async(callback)
end
if mp.get_time() >= deadline then
timer:kill()
_lua_log('attempt_start_pipeline_helper_async: timeout waiting for ready')
_lua_log('attempt_start_pipeline_helper_async: timeout waiting for ready ' .. _helper_ready_diagnostics())
-- Reset debounce so the next attempt is not immediate; gives the
-- still-running Python helper time to die or acquire the lock.
_helper_start_debounce_ts = mp.get_time()
@@ -3795,12 +3806,11 @@ local function _sync_current_web_url_from_playback()
end
end
mp.add_hook('on_load', 50, function(hook)
mp.add_hook('on_load', 50, function()
local ok, err = pcall(M._apply_web_subtitle_load_defaults, 'on_load')
if not ok then
_lua_log('web-subtitles: on_load setup failed err=' .. tostring(err))
end
hook:continue()
end)
local _current_store_url_status = {