mirror of https://github.com/mpv-player/mpv
osc.lua: observe playlist-count instead of playlist property
Observing playlist property with "native" type is too expensive for larger playlists, and we only observe this property to activate/deactivate next/prev buttons on the osc. We actually only need to know if the playlist-count has changed, nothing else. Fixes: https://github.com/mpv-player/mpv/issues/15264
This commit is contained in:
parent
91d4e6f937
commit
168fb56fe8
|
@ -2562,7 +2562,7 @@ end
|
|||
mp.register_event("shutdown", shutdown)
|
||||
mp.register_event("start-file", request_init)
|
||||
mp.observe_property("track-list", "native", request_init)
|
||||
mp.observe_property("playlist", "native", request_init)
|
||||
mp.observe_property("playlist-count", "native", request_init)
|
||||
mp.observe_property("chapter-list", "native", function(_, list)
|
||||
list = list or {} -- safety, shouldn't return nil
|
||||
table.sort(list, function(a, b) return a.time < b.time end)
|
||||
|
|
Loading…
Reference in New Issue