History

select.lua: don't needlessly initialize default_item

Guido Cella committed 2 years ago

Commit 8f596b41 parent 99fd55a1 file · +3 −3Browse files

Showing the changes to player/lua/select.lua (1 of 1 file). Show all

Unified · Split

player/lua/select.lua+3−3
@@ -27,7 +27,7 @@ end · 26 unmodified lines
27 27
28mp.add_forced_key_binding(nil, "select-playlist", function ()28mp.add_forced_key_binding(nil, "select-playlist", function ()
29 local playlist = {}29 local playlist = {}
30 local default_item = 130 local default_item
31 31
32 for i, entry in ipairs(mp.get_property_native("playlist")) do32 for i, entry in ipairs(mp.get_property_native("playlist")) do
33 playlist[i] = select(2, utils.split_path(entry.filename))33 playlist[i] = select(2, utils.split_path(entry.filename))
@@ -100,7 +100,7 @@ end) · 66 unmodified lines
100local function select_track(property, type, prompt, error)100local function select_track(property, type, prompt, error)
101 local tracks = {}101 local tracks = {}
102 local items = {}102 local items = {}
103 local default_item = 1103 local default_item
104 local track_id = mp.get_property_native(property)104 local track_id = mp.get_property_native(property)
105 105
106 for _, track in ipairs(mp.get_property_native("track-list")) do106 for _, track in ipairs(mp.get_property_native("track-list")) do
@@ -260,7 +260,7 @@ mp.add_forced_key_binding(nil, "select-audio-device", function () · 153 unmodified lines
260 -- otherwise its value is just auto and there is no current-audio-device260 -- otherwise its value is just auto and there is no current-audio-device
261 -- property.261 -- property.
262 local selected_device = mp.get_property("audio-device")262 local selected_device = mp.get_property("audio-device")
263 local default_item = 1263 local default_item
264 264
265 if #devices == 0 then265 if #devices == 0 then
266 show_error("No available audio devices.")266 show_error("No available audio devices.")

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t