diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2023-02-20 04:32:50 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-02-21 17:15:17 +0000 |
commit | 91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29 (patch) | |
tree | 448b141d92c9ea7636954213b587aaf380fc21db /video/decode | |
parent | b9850a6e8c45f95563a703af7f21dfe1c1ee40b6 (diff) | |
download | mpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.bz2 mpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.xz |
options: transition options from OPT_FLAG to OPT_BOOL
c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type
as a replacement for the flag type, but didn't actually transition and
remove the flag type because it would have been too much mundane work.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 2817bfedd5..82d78787d6 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -70,17 +70,17 @@ static int hwdec_opt_help(struct mp_log *log, const m_option_t *opt, #define OPT_BASE_STRUCT struct vd_lavc_params struct vd_lavc_params { - int fast; + bool fast; int film_grain; - int show_all; + bool show_all; int skip_loop_filter; int skip_idct; int skip_frame; int framedrop; int threads; - int bitexact; - int old_x264; - int check_hw_profile; + bool bitexact; + bool old_x264; + bool check_hw_profile; int software_fallback; char **avopts; int dr; @@ -103,18 +103,18 @@ static const struct m_opt_choice_alternatives discard_names[] = { const struct m_sub_options vd_lavc_conf = { .opts = (const m_option_t[]){ - {"vd-lavc-fast", OPT_FLAG(fast)}, + {"vd-lavc-fast", OPT_BOOL(fast)}, {"vd-lavc-film-grain", OPT_CHOICE(film_grain, {"auto", -1}, {"cpu", 0}, {"gpu", 1})}, - {"vd-lavc-show-all", OPT_FLAG(show_all)}, + {"vd-lavc-show-all", OPT_BOOL(show_all)}, {"vd-lavc-skiploopfilter", OPT_DISCARD(skip_loop_filter)}, {"vd-lavc-skipidct", OPT_DISCARD(skip_idct)}, {"vd-lavc-skipframe", OPT_DISCARD(skip_frame)}, {"vd-lavc-framedrop", OPT_DISCARD(framedrop)}, {"vd-lavc-threads", OPT_INT(threads), M_RANGE(0, DBL_MAX)}, - {"vd-lavc-bitexact", OPT_FLAG(bitexact)}, - {"vd-lavc-assume-old-x264", OPT_FLAG(old_x264)}, - {"vd-lavc-check-hw-profile", OPT_FLAG(check_hw_profile)}, + {"vd-lavc-bitexact", OPT_BOOL(bitexact)}, + {"vd-lavc-assume-old-x264", OPT_BOOL(old_x264)}, + {"vd-lavc-check-hw-profile", OPT_BOOL(check_hw_profile)}, {"vd-lavc-software-fallback", OPT_CHOICE(software_fallback, {"no", INT_MAX}, {"yes", 1}), M_RANGE(1, INT_MAX)}, {"vd-lavc-o", OPT_KEYVALUELIST(avopts)}, @@ -131,8 +131,7 @@ const struct m_sub_options vd_lavc_conf = { .size = sizeof(struct vd_lavc_params), .defaults = &(const struct vd_lavc_params){ .film_grain = -1 /*auto*/, - .show_all = 0, - .check_hw_profile = 1, + .check_hw_profile = true, .software_fallback = 3, .skip_loop_filter = AVDISCARD_DEFAULT, .skip_idct = AVDISCARD_DEFAULT, |