diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2024-03-30 04:22:12 +0800 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-13 23:09:42 +0200 |
commit | 6a8b130c6f90f21e5da9bde1da80409976aa2207 (patch) | |
tree | a2a6115993c8798cc2f2b81f2daf38a53f54c588 /TOOLS/lua | |
parent | 078da37d5cfbddec63105ba453112d85ec0fd788 (diff) | |
download | mpv-6a8b130c6f90f21e5da9bde1da80409976aa2207.tar.bz2 mpv-6a8b130c6f90f21e5da9bde1da80409976aa2207.tar.xz |
TOOLS/lua/autoload: fix allow extending ext sets from script-opts
https://github.com/mpv-player/mpv/commit/4eedb8710cccec719f393216f5f32b74025c7df9 has broken the normal work of this feature with --same_type=yes
Co-Authored-by: dyphire <qimoge@gmail.com>
Diffstat (limited to 'TOOLS/lua')
-rw-r--r-- | TOOLS/lua/autoload.lua | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua index 7ec6924d31..e0cfeb2997 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() |