From 7f7aa03eda33c10264d72a674e6e7eadff052254 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Jun 2014 01:39:51 +0200 Subject: ad_lavc: make option struct local Similar to previous commit. --- audio/decode/ad_lavc.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'audio') diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index fff3a92380..404cf19560 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -51,14 +51,28 @@ struct priv { static void uninit(struct dec_audio *da); static int decode_new_packet(struct dec_audio *da); -#define OPT_BASE_STRUCT struct MPOpts - -const m_option_t ad_lavc_decode_opts_conf[] = { - OPT_FLOATRANGE("ac3drc", ad_lavc_param.ac3drc, 0, 0, 2), - OPT_FLAG("downmix", ad_lavc_param.downmix, 0), - OPT_INTRANGE("threads", ad_lavc_param.threads, 0, 1, 16), - OPT_STRING("o", ad_lavc_param.avopt, 0), - {0} +#define OPT_BASE_STRUCT struct ad_lavc_params +struct ad_lavc_params { + float ac3drc; + int downmix; + int threads; + char *avopt; +}; + +const struct m_sub_options ad_lavc_conf = { + .opts = (const m_option_t[]) { + OPT_FLOATRANGE("ac3drc", ac3drc, 0, 0, 2), + OPT_FLAG("downmix", downmix, 0), + OPT_INTRANGE("threads", threads, 0, 1, 16), + OPT_STRING("o", avopt, 0), + {0} + }, + .size = sizeof(struct ad_lavc_params), + .defaults = &(const struct ad_lavc_params){ + .ac3drc = 1., + .downmix = 1, + .threads = 1, + }, }; struct pcm_map @@ -179,7 +193,7 @@ static void set_from_wf(AVCodecContext *avctx, MP_WAVEFORMATEX *wf) static int init(struct dec_audio *da, const char *decoder) { struct MPOpts *mpopts = da->opts; - struct ad_lavc_param *opts = &mpopts->ad_lavc_param; + struct ad_lavc_params *opts = mpopts->ad_lavc_params; AVCodecContext *lavc_context; AVCodec *lavc_codec; struct sh_stream *sh = da->header; -- cgit v1.2.3