Skip to content

Commit

Permalink
osc.lua: observe track-list/playlist property with type nil
Browse files Browse the repository at this point in the history
This partially undos the changes in de08494
for performance reasons. As mentioned in the original commit message,
these don't matter much since they change multiple times on each new
file anyway and the change was only done for correctness sake.

Fixes: #15264
  • Loading branch information
llyyr committed Nov 5, 2024
1 parent a61518d commit 7e2f01d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2561,8 +2561,8 @@ 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("track-list", nil, request_init)
mp.observe_property("playlist", nil, 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)
Expand Down

0 comments on commit 7e2f01d

Please sign in to comment.