summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-07 23:41:47 +0200
committerwm4 <wm4@nowhere>2014-06-08 00:03:45 +0200
commit924d4db0de4969b6713b96be73cc947bbff05ad1 (patch)
tree7ef9ad4ad9a49c88d2e672c7a2514fd1447787c5 /options/m_option.h
parent5cc68c792be1d0ae42017f6960ba1d0448646ff5 (diff)
downloadmpv-924d4db0de4969b6713b96be73cc947bbff05ad1.tar.bz2
mpv-924d4db0de4969b6713b96be73cc947bbff05ad1.tar.xz
options: change --sub-file behavior
--sub-file is actually a string list, so you can add multipel external subtitle files. But to be able to set a list, the option value was split on ",". This made it impossible to add filenames. One possible solution would be adding escaping. That's probably a good idea (and some other options already do this), but it's also complicated both to implement and for the user. The simpler solution is making --sub-file appending, and make it take only a single entry. I'm not quite sure about this yet. It breaks the invariant that if a value is printed and parsed, you get the same value back. So for now, just go with the simple solution. Fixes #840.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 6a38a7f4e6..b7579bd5e9 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -47,6 +47,7 @@ extern const m_option_type_t m_option_type_float;
extern const m_option_type_t m_option_type_double;
extern const m_option_type_t m_option_type_string;
extern const m_option_type_t m_option_type_string_list;
+extern const m_option_type_t m_option_type_string_append_list;
extern const m_option_type_t m_option_type_keyvalue_list;
extern const m_option_type_t m_option_type_time;
extern const m_option_type_t m_option_type_rel_time;
@@ -575,6 +576,9 @@ extern const char m_option_path_separator;
#define OPT_STRINGLIST(...) \
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list)
+#define OPT_STRING_APPEND_LIST(...) \
+ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list)
+
#define OPT_KEYVALUELIST(...) \
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_keyvalue_list)