aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-12 14:25:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-12 14:25:27 +0200
commit46de9ba5981531dcbfe05943448bebc5569fb3df (patch)
treeb87bb41229a7cf9cfea78b1973a6db121f60b9f4 /libavfilter/avfilter.c
parent6b5ec762830d2984da8d5cc4e3edd20899b9f45a (diff)
parent1ba95a9cca57b023b9b9de071a5671fc05b05e58 (diff)
downloadffmpeg-46de9ba5981531dcbfe05943448bebc5569fb3df.tar.gz
Merge commit '1ba95a9cca57b023b9b9de071a5671fc05b05e58'
* commit '1ba95a9cca57b023b9b9de071a5671fc05b05e58': lavfi: add avfilter_init_dict() for initializing a filter with a dict. Conflicts: libavfilter/avfilter.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 093bf56872..d912a42a55 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -688,6 +688,28 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
}
#endif
+int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
+{
+ int ret = 0;
+
+ if (ctx->filter->priv_class) {
+ ret = av_opt_set_dict(ctx->priv, options);
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n");
+ return ret;
+ }
+ }
+
+ if (ctx->filter->init_opaque)
+ ret = ctx->filter->init_opaque(ctx, NULL);
+ else if (ctx->filter->init)
+ ret = ctx->filter->init(ctx);
+ else if (ctx->filter->init_dict)
+ ret = ctx->filter->init_dict(ctx, options);
+
+ return ret;
+}
+
int avfilter_init_str(AVFilterContext *filter, const char *args)
{
AVDictionary *options = NULL;
@@ -794,20 +816,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
}
}
- if (filter->filter->priv_class) {
- ret = av_opt_set_dict(filter->priv, &options);
- if (ret < 0) {
- av_log(filter, AV_LOG_ERROR, "Error applying options to the filter.\n");
- goto fail;
- }
- }
-
- if (filter->filter->init_opaque)
- ret = filter->filter->init_opaque(filter, NULL);
- else if (filter->filter->init)
- ret = filter->filter->init(filter);
- else if (filter->filter->init_dict)
- ret = filter->filter->init_dict(filter, &options);
+ ret = avfilter_init_dict(filter, &options);
if (ret < 0)
goto fail;