While files are loading, track options have the value "auto". Print "-" in that case. Fixes 1a558bf5c2.
Showing the changes to player/lua/osc.lua (1 of 1 file). Show all
Unified · Split
| @@ -1863,8 +1863,13 @@ local function osc_init() · 1862 unmodified lines | ||
| 1863 | 1863 | |
| 1864 | 1864 | ne.enabled = audio_track_count > 0 |
| 1865 | 1865 | ne.content = function () |
| 1866 | + local aid = mp.get_property("aid") | |
| 1867 | + if aid == "no" or aid == "auto" then | |
| 1868 | + aid = "-" | |
| 1869 | + end | |
| 1870 | + | |
| 1866 | 1871 | return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " .. |
| 1867 | − (mp.get_property_native("aid") or "-") .. "/" .. audio_track_count) | |
| 1872 | + aid .. "/" .. audio_track_count) | |
| 1868 | 1873 | end |
| 1869 | 1874 | ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.audio_track_mbtn_left_command) |
| 1870 | 1875 | ne.eventresponder["shift+mbtn_left_up"] = command_callback( |
| @@ -1883,8 +1888,13 @@ local function osc_init() · 12 unmodified lines | ||
| 1883 | 1888 | |
| 1884 | 1889 | ne.enabled = sub_track_count > 0 |
| 1885 | 1890 | ne.content = function () |
| 1891 | + local sid = mp.get_property("sid") | |
| 1892 | + if sid == "no" or sid == "auto" then | |
| 1893 | + sid = "-" | |
| 1894 | + end | |
| 1895 | + | |
| 1886 | 1896 | return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " .. |
| 1887 | − (mp.get_property_native("sid") or "-") .. "/" .. sub_track_count) | |
| 1897 | + sid .. "/" .. sub_track_count) | |
| 1888 | 1898 | end |
| 1889 | 1899 | ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_left_command) |
| 1890 | 1900 | ne.eventresponder["shift+mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_mid_command) |