diff options
Diffstat (limited to 'options')
-rw-r--r-- | options/m_option.c | 6 | ||||
-rw-r--r-- | options/m_option.h | 5 | ||||
-rw-r--r-- | options/options.c | 16 |
3 files changed, 14 insertions, 13 deletions
diff --git a/options/m_option.c b/options/m_option.c index 9403817ed8..ae63044e50 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1164,6 +1164,8 @@ static int str_list_del(struct mp_log *log, char **del, int n, void *dst) talloc_free(lst[idx]); lst[idx] = NULL; s--; + if (i > 0) + mp_warn(log, "Passing multiple -del arguments is deprecated!\n"); } talloc_free(del); @@ -1252,9 +1254,7 @@ static int parse_str_list_impl(struct mp_log *log, const m_option_t *opt, return 1; } - // custom type for "profile" calls this but uses ->priv for something else - char separator = opt->type == &m_option_type_string_list && opt->priv ? - *(char *)opt->priv : OPTION_LIST_SEPARATOR; + char separator = opt->priv ? *(char *)opt->priv : OPTION_LIST_SEPARATOR; int n = 0; struct bstr str = param; while (str.len) { diff --git a/options/m_option.h b/options/m_option.h index fc879d44f1..8489077627 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -579,14 +579,11 @@ 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) #define OPT_PATHLIST(...) \ - OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list, \ + OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list, \ .priv = (void *)&m_option_path_separator) #define OPT_INT(...) \ diff --git a/options/options.c b/options/options.c index 3827709dcc..02dc5e94dd 100644 --- a/options/options.c +++ b/options/options.c @@ -289,7 +289,7 @@ const m_option_t mp_opts[] = { OPT_STRINGLIST("reset-on-next-file", reset_options, 0), #if HAVE_LUA || HAVE_JAVASCRIPT - OPT_STRINGLIST("script", script_files, M_OPT_FIXED | M_OPT_FILE), + OPT_PATHLIST("script", script_files, M_OPT_FIXED), OPT_KEYVALUELIST("script-opts", script_opts, 0), OPT_FLAG("load-scripts", auto_load_scripts, 0), #endif @@ -375,7 +375,7 @@ const m_option_t mp_opts[] = { #endif // demuxer.c - select audio/sub file/demuxer - OPT_STRING_APPEND_LIST("audio-file", audio_files, M_OPT_FILE), + OPT_PATHLIST("audio-file", audio_files, 0), OPT_STRING("demuxer", demuxer_name, 0), OPT_STRING("audio-demuxer", audio_demuxer_name, 0), OPT_STRING("sub-demuxer", sub_demuxer_name, 0), @@ -459,10 +459,10 @@ const m_option_t mp_opts[] = { // ------------------------- subtitles options -------------------- - OPT_STRING_APPEND_LIST("sub-file", sub_name, M_OPT_FILE), - OPT_PATHLIST("sub-paths", sub_paths, 0), - OPT_PATHLIST("audio-file-paths", audiofile_paths, 0), - OPT_STRING_APPEND_LIST("external-file", external_files, M_OPT_FILE), + OPT_PATHLIST("sub-file", sub_name, 0), + OPT_PATHLIST("sub-file-path", sub_paths, 0), + OPT_PATHLIST("audio-file-path", audiofile_paths, 0), + OPT_PATHLIST("external-file", external_files, 0), OPT_FLAG("autoload-files", autoload_files, 0), OPT_FLOAT("sub-delay", sub_delay, UPDATE_OSD), OPT_FLOAT("sub-fps", sub_fps, UPDATE_OSD), @@ -832,6 +832,10 @@ const m_option_t mp_opts[] = { OPT_REMOVED("fs-black-out-screens", NULL), OPT_REPLACED_MSG("loop", "loop-playlist", "--loop will be changed to map to" " --loop-file in future releases."), + OPT_REPLACED_MSG("sub-paths", "sub-file-path", + "passing multiple paths works differently now"), + OPT_REPLACED_MSG("audio-file-paths", "audio-file-path", + "passing multiple paths works differently now"), {0} }; |