diff options
author | wm4 <wm4@nowhere> | 2018-01-16 11:49:23 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-18 00:59:07 -0800 |
commit | ca67928d7ab176c080a7e99f0d4ce0c5d1070844 (patch) | |
tree | b58c0101645ab42ad482a8cac9e5446df8133116 /video/sws_utils.c | |
parent | c59db62f510dcb7c4bdff0d35fb1cce2c3b2c7a5 (diff) | |
download | mpv-ca67928d7ab176c080a7e99f0d4ce0c5d1070844.tar.bz2 mpv-ca67928d7ab176c080a7e99f0d4ce0c5d1070844.tar.xz |
sws_utils: don't force callers to provide option struct
mp_sws_set_from_cmdline() has the only purpose to respect the --sws-
command line options. Instead of forcing callers to get the option
struct containing these, let callers pass mpv_global, and get it from
the option core code directly. This avoids minor annoyances later on.
Diffstat (limited to 'video/sws_utils.c')
-rw-r--r-- | video/sws_utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c index c8dcf5493d..79017699c4 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -27,6 +27,7 @@ #include "sws_utils.h" #include "common/common.h" +#include "options/m_config.h" #include "options/m_option.h" #include "video/mp_image.h" #include "video/img_format.h" @@ -84,8 +85,10 @@ const int mp_sws_hq_flags = SWS_LANCZOS | SWS_FULL_CHR_H_INT | const int mp_sws_fast_flags = SWS_BILINEAR; // Set ctx parameters to global command line flags. -void mp_sws_set_from_cmdline(struct mp_sws_context *ctx, struct sws_opts *opts) +void mp_sws_set_from_cmdline(struct mp_sws_context *ctx, struct mpv_global *g) { + struct sws_opts *opts = mp_get_config_group(NULL, g, &sws_conf); + sws_freeFilter(ctx->src_filter); ctx->src_filter = sws_getDefaultFilter(opts->lum_gblur, opts->chr_gblur, opts->lum_sharpen, opts->chr_sharpen, @@ -94,6 +97,8 @@ void mp_sws_set_from_cmdline(struct mp_sws_context *ctx, struct sws_opts *opts) ctx->flags = SWS_PRINT_INFO; ctx->flags |= opts->scaler; + + talloc_free(opts); } bool mp_sws_supported_format(int imgfmt) |