From f79b08bf579fcaec388ef173cc737723c71ccb59 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 3 Nov 2012 11:37:04 +0100 Subject: make compile with recent libav --- cpudetect.c | 1 + encode_lavc.c | 28 ++++++++++++++-------------- libav_compat.h | 30 ++++++++++++++++++++++++++++++ libmpdemux/demux_lavf.c | 1 + 4 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 libav_compat.h diff --git a/cpudetect.c b/cpudetect.c index a7a8469cbd..283600aff6 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -21,6 +21,7 @@ #include #include +#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=", opt->name); break; - case FF_OPT_TYPE_INT: + case AV_OPT_TYPE_INT: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_INT64: + case AV_OPT_TYPE_INT64: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_DOUBLE: + case AV_OPT_TYPE_DOUBLE: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_FLOAT: + case AV_OPT_TYPE_FLOAT: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_STRING: + case AV_OPT_TYPE_STRING: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_RATIONAL: + case AV_OPT_TYPE_RATIONAL: snprintf(optbuf, sizeof(optbuf), "%s=", opt->name); break; - case FF_OPT_TYPE_BINARY: + case AV_OPT_TYPE_BINARY: snprintf(optbuf, sizeof(optbuf), "%s=", 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 #include #include +#include "libav_compat.h" #include "config.h" #include "options.h" -- cgit v1.2.3