History

TOOLS/lua/autoload: skip loading when playback is aborted

Quickly going through a directory with too many loadable files causes the autoload tasks to pile up and exiting the player will take forever. Avoid this by skipping loading when playback is aborted.

sunpenghao committed 2 years ago

Commit b1491be1 parent 3881dc31 file · +6 −0Browse files

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

Unified · Split

TOOLS/lua/autoload.lua+6−0
@@ -211,6 +211,12 @@ function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_file · 210 unmodified lines
211211 end
212212
213213 function find_and_add_entries()
214+ local aborted = mp.get_property_native("playback-abort")
215+ if aborted then
216+ msg.debug("stopping: playback aborted")
217+ return
218+ end
219+
214220 local path = mp.get_property("path", "")
215221 local dir, filename = utils.split_path(path)
216222 msg.trace(("dir: %s, filename: %s"):format(dir, filename))

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