diff options
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r-- | libavfilter/graphparser.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 9241cf3bf2..6cf19e9860 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -447,14 +447,12 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, return ret; } +#if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, - AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, - void *log_ctx) + AVFilterInOut *open_inputs, + AVFilterInOut *open_outputs, void *log_ctx) { -#if 0 int ret; - AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL; - AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL; AVFilterInOut *cur, *match, *inputs = NULL, *outputs = NULL; if ((ret = avfilter_graph_parse2(graph, filters, &inputs, &outputs)) < 0) @@ -508,14 +506,22 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, } avfilter_inout_free(&inputs); avfilter_inout_free(&outputs); - /* clear open_in/outputs only if not passed as parameters */ - if (open_inputs_ptr) *open_inputs_ptr = open_inputs; - else avfilter_inout_free(&open_inputs); - if (open_outputs_ptr) *open_outputs_ptr = open_outputs; - else avfilter_inout_free(&open_outputs); + avfilter_inout_free(&open_inputs); + avfilter_inout_free(&open_outputs); return ret; -} #else +int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, + AVFilterInOut **inputs, AVFilterInOut **outputs, + void *log_ctx) +{ + return avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx); +} +#endif + +int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, + AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, + void *log_ctx) +{ int index = 0, ret = 0; char chr = 0; @@ -595,5 +601,3 @@ end: } return ret; } - -#endif |