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.
Showing the changes to TOOLS/lua (1 of 1 file). Show all
Unified · Split
| @@ -211,6 +211,12 @@ function scan_dir(path, current_file, dir_mode, separator, dir_depth, total_file · 210 unmodified lines | |||
| 211 | end | 211 | end |
| 212 | 212 | ||
| 213 | function find_and_add_entries() | 213 | 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 | |||
| 214 | local path = mp.get_property("path", "") | 220 | local path = mp.get_property("path", "") |
| 215 | local dir, filename = utils.split_path(path) | 221 | local dir, filename = utils.split_path(path) |
| 216 | msg.trace(("dir: %s, filename: %s"):format(dir, filename)) | 222 | msg.trace(("dir: %s, filename: %s"):format(dir, filename)) |