diff options
author | wm4 <wm4@nowhere> | 2016-09-17 18:07:40 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-17 18:07:40 +0200 |
commit | dc48893630d11829121a45137460afb45e24ef2d (patch) | |
tree | e9209740429c15bfa768d3f9c5086cf8ef760df9 /video | |
parent | d1d5e9dda430b2aa7172308ad7c6639913680af5 (diff) | |
download | mpv-dc48893630d11829121a45137460afb45e24ef2d.tar.bz2 mpv-dc48893630d11829121a45137460afb45e24ef2d.tar.xz |
options: simplify M_OPT_EXIT
There were multiple values under M_OPT_EXIT (M_OPT_EXIT-n for n>=0).
Somehow M_OPT_EXIT-n either meant error code n (with n==0 no error?), or
the number of option valus consumed (0 or 1). The latter is MPlayer
legacy, which left it to the option type parsers to determine whether an
option took a value or not. All of this was changed in mpv, by requiring
the user to use explicit syntax ("--opt=val" instead of "-opt val").
In any case, the n value wasn't even used (anymore), so rip this all
out. Now M_OPT_EXIT-1 doesn't mean anything, and could be used by a new
error code.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/opengl/context.c | 2 | ||||
-rw-r--r-- | video/out/opengl/video.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c index a22227562a..32e7c4a3d6 100644 --- a/video/out/opengl/context.c +++ b/video/out/opengl/context.c @@ -114,7 +114,7 @@ int mpgl_validate_backend_opt(struct mp_log *log, const struct m_option *opt, mp_info(log, " auto (autodetect)\n"); for (int n = 0; n < MP_ARRAY_SIZE(backends); n++) mp_info(log, " %s\n", backends[n]->name); - return M_OPT_EXIT - 1; + return M_OPT_EXIT; } char s[20]; snprintf(s, sizeof(s), "%.*s", BSTR_P(param)); diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 4b17d1ce12..546d9cc9e5 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -3535,7 +3535,7 @@ static int validate_scaler_opt(struct mp_log *log, const m_option_t *opt, int r = 1; bool tscale = bstr_equals0(name, "tscale"); if (bstr_equals0(param, "help")) { - r = M_OPT_EXIT - 1; + r = M_OPT_EXIT; } else { snprintf(s, sizeof(s), "%.*s", BSTR_P(param)); if (!handle_scaler_opt(s, tscale)) @@ -3564,7 +3564,7 @@ static int validate_window_opt(struct mp_log *log, const m_option_t *opt, char s[20] = {0}; int r = 1; if (bstr_equals0(param, "help")) { - r = M_OPT_EXIT - 1; + r = M_OPT_EXIT; } else { snprintf(s, sizeof(s), "%.*s", BSTR_P(param)); const struct filter_window *window = mp_find_filter_window(s); |