summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-20 14:47:41 +0200
committerwm4 <wm4@nowhere>2015-09-20 15:36:52 +0200
commit3586e6ceeb35da315883449cec3929a9d56261fe (patch)
tree82b1049d1bb4f436748b688b2d0025758c81603a
parent21e5e4da4baa92fab9e830ec5a62bbccdea85cf0 (diff)
downloadmpv-3586e6ceeb35da315883449cec3929a9d56261fe.tar.bz2
mpv-3586e6ceeb35da315883449cec3929a9d56261fe.tar.xz
vf_yadif: add hack for Libav compatibility
Libav accepts slightly different options compared to FFmpeg. Sigh... This was "broken" in 25755f5f. Fixes #2335.
-rw-r--r--video/filter/vf_yadif.c15
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;