diff options
author | sunpenghao <sunpenghao1997@outlook.com> | 2024-01-10 23:41:25 +0800 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-01-20 16:09:12 +0000 |
commit | b1491bed28ffad2adb23d704241ca4cbfcae8df3 (patch) | |
tree | 5b4a41476186943e539de5dc482546fbe4de1d3e | |
parent | 3881dc37c5aedf8fe91f19b189a4aeee012b3ca8 (diff) | |
download | mpv-b1491bed28ffad2adb23d704241ca4cbfcae8df3.tar.bz2 mpv-b1491bed28ffad2adb23d704241ca4cbfcae8df3.tar.xz |
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.
-rw-r--r-- | TOOLS/lua/autoload.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index 4003cbcd34..7ec6924d31 100644 --- a/TOOLS/lua/autoload.lua +++ b/TOOLS/lua/autoload.lua @@ -211,6 +211,12 @@ function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_file end function find_and_add_entries() + local aborted = mp.get_property_native("playback-abort") + if aborted then + msg.debug("stopping: playback aborted") + return + end + local path = mp.get_property("path", "") local dir, filename = utils.split_path(path) msg.trace(("dir: %s, filename: %s"):format(dir, filename)) |