From 168fb56fe87cd9c7a7e903f38af04d21b80f007c Mon Sep 17 00:00:00 2001 From: llyyr Date: Tue, 5 Nov 2024 18:26:30 +0530 Subject: [PATCH] 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 --- player/lua/osc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 38a12bf68a..f90b40b26f 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -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)