summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-08 17:19:04 +0100
committerwm4 <wm4@nowhere>2016-01-08 17:19:04 +0100
commit2a80680d95fd86242579ad4dcaa752f481945b4e (patch)
tree7b8890db06cc061368a597a459965ac25805a20d
parent8e87ddd7fe21bf15fbc9db1493edf296f0e30b61 (diff)
downloadmpv-2a80680d95fd86242579ad4dcaa752f481945b4e.tar.bz2
mpv-2a80680d95fd86242579ad4dcaa752f481945b4e.tar.xz
Fix build on older libavcodec versions
avcodec_profile_name() was added only a week ago or so.
-rwxr-xr-xTOOLS/old-configure1
-rw-r--r--video/decode/vd_lavc.c2
-rw-r--r--wscript6
3 files changed, 9 insertions, 0 deletions
diff --git a/TOOLS/old-configure b/TOOLS/old-configure
index 652dd1eef1..307e2c94a0 100755
--- a/TOOLS/old-configure
+++ b/TOOLS/old-configure
@@ -974,6 +974,7 @@ cat > $TMPC << EOF
#define HAVE_GPL3 1
#define HAVE_WIN32 0
#define HAVE_GL_DXINTEROP 0
+#define HAVE_AVCODEC_PROFILE_NAME 1
#ifdef __OpenBSD__
#define DEFAULT_CDROM_DEVICE "/dev/rcd0c"
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index f16136b75a..d3c0de2c76 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -529,9 +529,11 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,
MP_VERBOSE(vd, " %s", av_get_pix_fmt_name(fmt[i]));
MP_VERBOSE(vd, "\n");
+#if HAVE_AVCODEC_PROFILE_NAME
const char *profile = avcodec_profile_name(avctx->codec_id, avctx->profile);
MP_VERBOSE(vd, "Codec profile: %s (0x%x)\n", profile ? profile : "unknown",
avctx->profile);
+#endif
assert(ctx->hwdec);
diff --git a/wscript b/wscript
index 47071848aa..837f5dd62c 100644
--- a/wscript
+++ b/wscript
@@ -477,6 +477,12 @@ FFmpeg/Libav libraries. You need at least {0}. Aborting.".format(libav_versions_
'func': check_statement('libavcodec/avcodec.h',
'AVSubtitleRect r = {.linesize={0}}',
use='libav'),
+ }, {
+ 'name': 'avcodec-profile-name',
+ 'desc': 'libavcodec avcodec_profile_name()',
+ 'func': check_statement('libavcodec/avcodec.h',
+ 'avcodec_profile_name(0,0)',
+ use='libav'),
},
]