diff options
author | wm4 <wm4@nowhere> | 2014-08-02 03:12:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-02 03:12:33 +0200 |
commit | d68a759fa4dea2701087039c58961757eb246b4f (patch) | |
tree | 07efabb3a1bf1bdcc0b80f6150f996aacf293ca6 /video/decode | |
parent | 0c6c2da8bcdb0f1523c0f10bc117c41057875e34 (diff) | |
download | mpv-d68a759fa4dea2701087039c58961757eb246b4f.tar.bz2 mpv-d68a759fa4dea2701087039c58961757eb246b4f.tar.xz |
Improve setting AVOptions
Use OPT_KEYVALUELIST() for all places where AVOptions are directly set
from mpv command line options. This allows escaping values, better
diagnostics (also no more "pal"), and somehow reduces code size.
Remove the old crappy option parser (av_opts.c).
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index a59fffa790..75f66ce1f1 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -35,7 +35,6 @@ #include "common/msg.h" #include "options/options.h" #include "bstr/bstr.h" -#include "common/av_opts.h" #include "common/av_common.h" #include "common/codecs.h" @@ -79,7 +78,7 @@ struct vd_lavc_params { int threads; int bitexact; int check_hw_profile; - char *avopt; + char **avopts; }; static const struct m_opt_choice_alternatives discard_names[] = { @@ -105,7 +104,7 @@ const struct m_sub_options vd_lavc_conf = { OPT_INTRANGE("threads", threads, 0, 0, 16), OPT_FLAG("bitexact", bitexact, 0), OPT_FLAG("check-hw-profile", check_hw_profile, 0), - OPT_STRING("o", avopt, 0), + OPT_KEYVALUELIST("o", avopts, 0), {0} }, .size = sizeof(struct vd_lavc_params), @@ -383,14 +382,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->skip_idct = lavc_param->skip_idct; avctx->skip_frame = lavc_param->skip_frame; - if (lavc_param->avopt) { - if (parse_avopts(avctx, lavc_param->avopt) < 0) { - MP_ERR(vd, "Your options /%s/ look like gibberish to me pal\n", - lavc_param->avopt); - uninit_avctx(vd); - return; - } - } + mp_set_avopts(vd->log, avctx, lavc_param->avopts); // Do this after the above avopt handling in case it changes values ctx->skip_frame = avctx->skip_frame; |