summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-11-03 11:37:04 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2012-11-03 12:17:13 +0100
commitf79b08bf579fcaec388ef173cc737723c71ccb59 (patch)
tree5b1762ad2cf27a3be4baf1f7e94e169a104e9ee3
parent11173115bba7747870932e16cee8c5794494bd87 (diff)
downloadmpv-f79b08bf579fcaec388ef173cc737723c71ccb59.tar.bz2
mpv-f79b08bf579fcaec388ef173cc737723c71ccb59.tar.xz
make compile with recent libav
-rw-r--r--cpudetect.c1
-rw-r--r--encode_lavc.c28
-rw-r--r--libav_compat.h30
-rw-r--r--libmpdemux/demux_lavf.c1
4 files changed, 46 insertions, 14 deletions
diff --git a/cpudetect.c b/cpudetect.c
index a7a8469cbd..283600aff6 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <libavutil/cpu.h>
+#include "libav_compat.h"
#include "config.h"
#include "cpudetect.h"
diff --git a/encode_lavc.c b/encode_lavc.c
index 66f434410a..5812fe0fed 100644
--- a/encode_lavc.c
+++ b/encode_lavc.c
@@ -769,44 +769,44 @@ static void encode_lavc_printoptions(void *obj, const char *indent,
* Don't print anything but CONST's on level two.
* Only print items from the requested unit.
*/
- if (!unit && opt->type == FF_OPT_TYPE_CONST)
+ if (!unit && opt->type == AV_OPT_TYPE_CONST)
continue;
- else if (unit && opt->type != FF_OPT_TYPE_CONST)
+ else if (unit && opt->type != AV_OPT_TYPE_CONST)
continue;
- else if (unit && opt->type == FF_OPT_TYPE_CONST
+ else if (unit && opt->type == AV_OPT_TYPE_CONST
&& strcmp(unit, opt->unit))
continue;
- else if (unit && opt->type == FF_OPT_TYPE_CONST)
+ else if (unit && opt->type == AV_OPT_TYPE_CONST)
mp_msg(MSGT_ENCODE, MSGL_INFO, "%s", subindent);
else
mp_msg(MSGT_ENCODE, MSGL_INFO, "%s", indent);
switch (opt->type) {
- case FF_OPT_TYPE_FLAGS:
+ case AV_OPT_TYPE_FLAGS:
snprintf(optbuf, sizeof(optbuf), "%s=<flags>", opt->name);
break;
- case FF_OPT_TYPE_INT:
+ case AV_OPT_TYPE_INT:
snprintf(optbuf, sizeof(optbuf), "%s=<int>", opt->name);
break;
- case FF_OPT_TYPE_INT64:
+ case AV_OPT_TYPE_INT64:
snprintf(optbuf, sizeof(optbuf), "%s=<int64>", opt->name);
break;
- case FF_OPT_TYPE_DOUBLE:
+ case AV_OPT_TYPE_DOUBLE:
snprintf(optbuf, sizeof(optbuf), "%s=<double>", opt->name);
break;
- case FF_OPT_TYPE_FLOAT:
+ case AV_OPT_TYPE_FLOAT:
snprintf(optbuf, sizeof(optbuf), "%s=<float>", opt->name);
break;
- case FF_OPT_TYPE_STRING:
+ case AV_OPT_TYPE_STRING:
snprintf(optbuf, sizeof(optbuf), "%s=<string>", opt->name);
break;
- case FF_OPT_TYPE_RATIONAL:
+ case AV_OPT_TYPE_RATIONAL:
snprintf(optbuf, sizeof(optbuf), "%s=<rational>", opt->name);
break;
- case FF_OPT_TYPE_BINARY:
+ case AV_OPT_TYPE_BINARY:
snprintf(optbuf, sizeof(optbuf), "%s=<binary>", opt->name);
break;
- case FF_OPT_TYPE_CONST:
+ case AV_OPT_TYPE_CONST:
snprintf(optbuf, sizeof(optbuf), " [+-]%s", opt->name);
break;
default:
@@ -818,7 +818,7 @@ static void encode_lavc_printoptions(void *obj, const char *indent,
if (opt->help)
mp_msg(MSGT_ENCODE, MSGL_INFO, " %s", opt->help);
mp_msg(MSGT_ENCODE, MSGL_INFO, "\n");
- if (opt->unit && opt->type != FF_OPT_TYPE_CONST)
+ if (opt->unit && opt->type != AV_OPT_TYPE_CONST)
encode_lavc_printoptions(obj, indent, subindent, opt->unit,
filter_and, filter_eq);
}
diff --git a/libav_compat.h b/libav_compat.h
new file mode 100644
index 0000000000..825ef42f58
--- /dev/null
+++ b/libav_compat.h
@@ -0,0 +1,30 @@
+/*
+ * This file is part of mpv.
+ *
+ * mpv is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPV_LIBAV_COMPAT_H
+#define MPV_LIBAV_COMPAT_H
+
+#ifdef AV_CPU_FLAG_MMXEXT
+#define AV_CPU_FLAG_MMX2 AV_CPU_FLAG_MMXEXT
+#endif
+
+#if LIBAVUTIL_VERSION_MICRO < 100
+#define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT
+#endif
+
+#endif /* MPV_LIBAV_COMPAT_H */
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index dadf81e146..35f3f6a83e 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -32,6 +32,7 @@
#include <libavutil/avstring.h>
#include <libavutil/mathematics.h>
#include <libavutil/opt.h>
+#include "libav_compat.h"
#include "config.h"
#include "options.h"