diff options
author | wm4 <wm4@nowhere> | 2015-09-20 14:47:41 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-20 15:36:52 +0200 |
commit | 3586e6ceeb35da315883449cec3929a9d56261fe (patch) | |
tree | 82b1049d1bb4f436748b688b2d0025758c81603a /video | |
parent | 21e5e4da4baa92fab9e830ec5a62bbccdea85cf0 (diff) |
vf_yadif: add hack for Libav compatibility
Libav accepts slightly different options compared to FFmpeg. Sigh...
This was "broken" in 25755f5f. Fixes #2335.
Diffstat (limited to 'video')
-rw-r--r-- | video/filter/vf_yadif.c | 15 |
1 files 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 <stdlib.h> +#include <libavfilter/version.h> + #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; |