Skip to content

Commit

Permalink
osc.lua: simplify track ID retrival
Browse files Browse the repository at this point in the history
When track IDs are auto mp.get_property_native() returns "auto", but
mp.get_property_number() returns nil.

Follow up to 1a558bf and 897c04a.
  • Loading branch information
guidocella authored and kasper93 committed Dec 13, 2024
1 parent 5e4b825 commit e52f975
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1856,13 +1856,8 @@ local function osc_init()

ne.enabled = audio_track_count > 0
ne.content = function ()
local aid = mp.get_property("aid")
if aid == "no" or aid == "auto" then
aid = "-"
end

return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..
aid .. "/" .. audio_track_count)
mp.get_property_number("aid", "-") .. "/" .. audio_track_count)
end
bind_mouse_buttons("audio_track")

Expand All @@ -1871,13 +1866,8 @@ local function osc_init()

ne.enabled = sub_track_count > 0
ne.content = function ()
local sid = mp.get_property("sid")
if sid == "no" or sid == "auto" then
sid = "-"
end

return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..
sid .. "/" .. sub_track_count)
mp.get_property_number("sid", "-") .. "/" .. sub_track_count)
end
bind_mouse_buttons("sub_track")

Expand Down

0 comments on commit e52f975

Please sign in to comment.