mirror of
https://github.com/mpv-player/mpv
synced 2025-01-17 20:48:46 +00:00
osc: completely disable if no VO window exists
Fixes relatively excessive CPU usage when paused while playing audio only.
This commit is contained in:
parent
2d77818183
commit
fce864acec
@ -1952,7 +1952,6 @@ end
|
||||
|
||||
validate_user_opts()
|
||||
|
||||
mp.register_event("tick", tick)
|
||||
mp.register_event("start-file", request_init)
|
||||
mp.register_event("tracks-changed", request_init)
|
||||
|
||||
@ -1974,6 +1973,13 @@ mp.observe_property("idle", "bool",
|
||||
)
|
||||
mp.observe_property("pause", "bool", pause_state)
|
||||
mp.observe_property("cache-idle", "bool", cache_state)
|
||||
mp.observe_property("vo-configured", "bool", function(name, val)
|
||||
if val then
|
||||
mp.register_event("tick", tick)
|
||||
else
|
||||
mp.unregister_event(tick)
|
||||
end
|
||||
end)
|
||||
|
||||
-- mouse show/hide bindings
|
||||
mp.set_key_bindings({
|
||||
|
Loading…
Reference in New Issue
Block a user