From ca08ce77a95c91868a872671c4eca1438f905bb1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Apr 2013 12:28:11 +0200 Subject: vf_lavfi: move compat crap to the start of the file --- video/filter/vf_lavfi.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'video') diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c index 6dbbeca8f2..0b01e9b425 100644 --- a/video/filter/vf_lavfi.c +++ b/video/filter/vf_lavfi.c @@ -47,6 +47,24 @@ #define IS_LIBAV_FORK (LIBAVFILTER_VERSION_MICRO < 100) +// FFmpeg and Libav have slightly different APIs, just enough to cause us +// unnecessary pain. +#if IS_LIBAV_FORK +#define graph_parse(graph, filters, inputs, outputs, log_ctx) \ + avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx) +#else +#define graph_parse(graph, filters, inputs, outputs, log_ctx) \ + avfilter_graph_parse(graph, filters, &(inputs), &(outputs), log_ctx) +#endif + +// ":" is deprecated, but "|" doesn't work in earlier versions. +#if (IS_LIBAV_FORK && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3, 7, 0)) || \ + (!IS_LIBAV_FORK && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3, 50, 100)) +#define FMTSEP "|" +#else +#define FMTSEP ":" +#endif + struct vf_priv_s { AVFilterGraph *graph; AVFilterContext *in; @@ -72,24 +90,6 @@ static void destroy_graph(struct vf_instance *vf) p->in = p->out = NULL; } -// FFmpeg and Libav have slightly different APIs, just enough to cause us -// unnecessary pain. -#if IS_LIBAV_FORK -#define graph_parse(graph, filters, inputs, outputs, log_ctx) \ - avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx) -#else -#define graph_parse(graph, filters, inputs, outputs, log_ctx) \ - avfilter_graph_parse(graph, filters, &(inputs), &(outputs), log_ctx) -#endif - -// ":" is deprecated, but "|" doesn't work in earlier versions. -#if (IS_LIBAV_FORK && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3, 7, 0)) || \ - (!IS_LIBAV_FORK && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3, 50, 100)) -#define FMTSEP "|" -#else -#define FMTSEP ":" -#endif - static AVRational par_from_sar_dar(int width, int height, int d_width, int d_height) { -- cgit v1.2.3