summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua/autoload.lua
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /TOOLS/lua/autoload.lua
parentAdding upstream version 0.37.0. (diff)
downloadmpv-85641ae1aad608329bed81c5ced87e668b7f629e.tar.xz
mpv-85641ae1aad608329bed81c5ced87e668b7f629e.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--TOOLS/lua/autoload.lua30
1 files changed, 24 insertions, 6 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua
index 4003cbc..e0cfeb2 100644
--- a/TOOLS/lua/autoload.lua
+++ b/TOOLS/lua/autoload.lua
@@ -73,17 +73,17 @@ function Split (s)
return set
end
-EXTENSIONS_VIDEO = Set {
+EXTENSIONS_VIDEO_DEFAULT = Set {
'3g2', '3gp', 'avi', 'flv', 'm2ts', 'm4v', 'mj2', 'mkv', 'mov',
'mp4', 'mpeg', 'mpg', 'ogv', 'rmvb', 'webm', 'wmv', 'y4m'
}
-EXTENSIONS_AUDIO = Set {
+EXTENSIONS_AUDIO_DEFAULT = Set {
'aiff', 'ape', 'au', 'flac', 'm4a', 'mka', 'mp3', 'oga', 'ogg',
'ogm', 'opus', 'wav', 'wma'
}
-EXTENSIONS_IMAGES = Set {
+EXTENSIONS_IMAGES_DEFAULT = Set {
'avif', 'bmp', 'gif', 'j2k', 'jp2', 'jpeg', 'jpg', 'jxl', 'png',
'svg', 'tga', 'tif', 'tiff', 'webp'
}
@@ -97,9 +97,21 @@ split_option_exts(true, true, true)
function create_extensions()
EXTENSIONS = {}
- if o.videos then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_VIDEO), o.additional_video_exts) end
- if o.audio then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_AUDIO), o.additional_audio_exts) end
- if o.images then SetUnion(SetUnion(EXTENSIONS, EXTENSIONS_IMAGES), o.additional_image_exts) end
+ EXTENSIONS_VIDEO = {}
+ EXTENSIONS_AUDIO = {}
+ EXTENSIONS_IMAGES = {}
+ if o.videos then
+ SetUnion(SetUnion(EXTENSIONS_VIDEO, EXTENSIONS_VIDEO_DEFAULT), o.additional_video_exts)
+ SetUnion(EXTENSIONS, EXTENSIONS_VIDEO)
+ end
+ if o.audio then
+ SetUnion(SetUnion(EXTENSIONS_AUDIO, EXTENSIONS_AUDIO_DEFAULT), o.additional_audio_exts)
+ SetUnion(EXTENSIONS, EXTENSIONS_AUDIO)
+ end
+ if o.images then
+ SetUnion(SetUnion(EXTENSIONS_IMAGES, EXTENSIONS_IMAGES_DEFAULT), o.additional_image_exts)
+ SetUnion(EXTENSIONS, EXTENSIONS_IMAGES)
+ end
end
create_extensions()
@@ -211,6 +223,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))