vf_lavfi: move compat crap to the start of the file

This commit is contained in:
wm4 2013-04-26 12:28:11 +02:00
parent 3ffeeee411
commit ca08ce77a9
1 changed files with 18 additions and 18 deletions

View File

@ -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. <Expletive deleted.>
#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. <Expletive deleted.>
#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)
{