From 3586e6ceeb35da315883449cec3929a9d56261fe Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 20 Sep 2015 14:47:41 +0200 Subject: vf_yadif: add hack for Libav compatibility Libav accepts slightly different options compared to FFmpeg. Sigh... This was "broken" in 25755f5f. Fixes #2335. --- video/filter/vf_yadif.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c index 7bfd209475..7fec046235 100644 --- a/video/filter/vf_yadif.c +++ b/video/filter/vf_yadif.c @@ -19,6 +19,8 @@ #include +#include + #include "options/options.h" #include "common/msg.h" @@ -36,9 +38,7 @@ static int vf_open(vf_instance_t *vf) { struct vf_priv_s *p = vf->priv; - // Earlier libavfilter yadif versions used pure integers for the first - // option. We can't/don't handle this, but at least allow usage of the - // filter with default settings. So use an empty string for "send_frame". +#if LIBAVFILTER_VERSION_MICRO >= 100 const char *mode[] = {"send_frame", "send_field", "send_frame_nospatial", "send_field_nospatial"}; @@ -47,6 +47,15 @@ static int vf_open(vf_instance_t *vf) { return 1; } +#else + // Libav numeric modes happen to match ours, but keep it explicit. + const char *mode[] = {"0", "1", "2", "3"}; + if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "mode=%s:auto=%d", mode[p->mode], + p->interlaced_only) >= 0) + { + return 1; + } +#endif MP_FATAL(vf, "This version of libavfilter has no 'yadif' filter.\n"); return 0; -- cgit v1.2.3