static int init_report(const char *env);
struct SwsContext *sws_opts;
-SwrContext *swr_opts;
+AVDictionary *swr_opts;
AVDictionary *format_opts, *codec_opts, *resample_opts;
const int this_year = 2013;
if(CONFIG_SWSCALE)
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
NULL, NULL, NULL);
-
- if(CONFIG_SWRESAMPLE)
- swr_opts = swr_alloc();
}
void uninit_opts(void)
sws_opts = NULL;
#endif
- if(CONFIG_SWRESAMPLE)
- swr_free(&swr_opts);
-
+ av_dict_free(&swr_opts);
av_dict_free(&format_opts);
av_dict_free(&codec_opts);
av_dict_free(&resample_opts);
char opt_stripped[128];
const char *p;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
- const av_unused AVClass *rc_class;
+#if CONFIG_AVRESAMPLE
+ const AVClass *rc = avresample_get_class();
+#endif
const AVClass *sc, *swr_class;
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
#endif
#if CONFIG_SWRESAMPLE
swr_class = swr_get_class();
- if (!consumed && av_opt_find(&swr_class, opt, NULL, 0,
- AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
- int ret = av_opt_set(swr_opts, opt, arg, 0);
+ if (!consumed && (o=av_opt_find(&swr_class, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
+ struct SwrContext *swr = swr_alloc();
+ int ret = av_opt_set(swr, opt, arg, 0);
+ swr_free(&swr);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret;
}
+ av_dict_set(&swr_opts, opt, arg, FLAGS);
consumed = 1;
}
#endif
#if CONFIG_AVRESAMPLE
- rc_class = avresample_get_class();
- if (av_opt_find(&rc_class, opt, NULL, 0,
- AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
+ if ((o=av_opt_find(&rc, opt, NULL, 0,
+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
av_dict_set(&resample_opts, opt, arg, FLAGS);
consumed = 1;
}
#if CONFIG_SWSCALE
sws_freeContext(l->groups[j].sws_opts);
#endif
- if(CONFIG_SWRESAMPLE)
- swr_free(&l->groups[j].swr_opts);
+ av_dict_free(&l->groups[j].swr_opts);
}
av_freep(&l->groups);
}