summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_lavfi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-26 12:28:11 +0200
committerwm4 <wm4@nowhere>2013-04-26 20:40:27 +0200
commitca08ce77a95c91868a872671c4eca1438f905bb1 (patch)
tree0705d96b54c6da546f2affb7186342877eaf62ab /video/filter/vf_lavfi.c
parent3ffeeee411614ebc93bb5dbdd2a71a85279af3b2 (diff)
downloadmpv-ca08ce77a95c91868a872671c4eca1438f905bb1.tar.bz2
mpv-ca08ce77a95c91868a872671c4eca1438f905bb1.tar.xz
vf_lavfi: move compat crap to the start of the file
Diffstat (limited to 'video/filter/vf_lavfi.c')
-rw-r--r--video/filter/vf_lavfi.c36
1 files changed, 18 insertions, 18 deletions
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. <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)
{