mirror of https://github.com/mpv-player/mpv
vf_lavfi: move compat crap to the start of the file
This commit is contained in:
parent
3ffeeee411
commit
ca08ce77a9
|
@ -47,6 +47,24 @@
|
||||||
|
|
||||||
#define IS_LIBAV_FORK (LIBAVFILTER_VERSION_MICRO < 100)
|
#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 {
|
struct vf_priv_s {
|
||||||
AVFilterGraph *graph;
|
AVFilterGraph *graph;
|
||||||
AVFilterContext *in;
|
AVFilterContext *in;
|
||||||
|
@ -72,24 +90,6 @@ static void destroy_graph(struct vf_instance *vf)
|
||||||
p->in = p->out = NULL;
|
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,
|
static AVRational par_from_sar_dar(int width, int height,
|
||||||
int d_width, int d_height)
|
int d_width, int d_height)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue