From 6a4a5595d8d2a17188cdea64dfdfceed88d1905a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 Jun 2014 02:08:48 +0200 Subject: options: remove OPT_FLAG_CONSTANTS This means use of the min/max fields can be dropped for the flag option type, which makes some things slightly easier. I'm also not sure if the client API handled the case of flag not being 0 or 1 correctly, and this change gets rid of this concern. --- video/decode/vd_lavc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 399265ac50..5af70aebe5 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -97,13 +97,13 @@ static const struct m_opt_choice_alternatives discard_names[] = { const struct m_sub_options vd_lavc_conf = { .opts = (const m_option_t[]){ - OPT_FLAG_CONSTANTS("fast", fast, 0, 0, CODEC_FLAG2_FAST), + OPT_FLAG("fast", fast, 0), OPT_FLAG("show-all", show_all, 0), OPT_DISCARD("skiploopfilter", skip_loop_filter, 0), OPT_DISCARD("skipidct", skip_idct, 0), OPT_DISCARD("skipframe", skip_frame, 0), OPT_INTRANGE("threads", threads, 0, 0, 16), - OPT_FLAG_CONSTANTS("bitexact", bitexact, 0, 0, CODEC_FLAG_BITEXACT), + OPT_FLAG("bitexact", bitexact, 0), OPT_FLAG("check-hw-profile", check_hw_profile, 0), OPT_STRING("o", avopt, 0), {0} @@ -367,9 +367,9 @@ static void init_avctx(struct dec_video *vd, const char *decoder, mp_set_avcodec_threads(avctx, lavc_param->threads); } - avctx->flags |= lavc_param->bitexact; + avctx->flags |= lavc_param->bitexact ? CODEC_FLAG_BITEXACT : 0; + avctx->flags2 |= lavc_param->fast ? CODEC_FLAG2_FAST : 0; - avctx->flags2 |= lavc_param->fast; if (lavc_param->show_all) { #ifdef CODEC_FLAG2_SHOW_ALL avctx->flags2 |= CODEC_FLAG2_SHOW_ALL; // ffmpeg only? -- cgit v1.2.3