summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-13 02:08:48 +0200
committerwm4 <wm4@nowhere>2014-06-13 02:10:45 +0200
commit6a4a5595d8d2a17188cdea64dfdfceed88d1905a (patch)
tree67ae9607f27ea120c7d1299cdf0bbbb603e5789e /video
parent09a61ba03ab0918d045d02427ccdc775abc38f03 (diff)
downloadmpv-6a4a5595d8d2a17188cdea64dfdfceed88d1905a.tar.bz2
mpv-6a4a5595d8d2a17188cdea64dfdfceed88d1905a.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c8
1 files changed, 4 insertions, 4 deletions
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?