aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-08 14:25:34 +0100
committerMax Kellermann <max@duempel.org>2014-12-08 14:25:34 +0100
commit41b4a63f2b772eba1e436c82fc9c5c9766d4470e (patch)
tree166fce329f32a784ac4a31f6e495cc5863276ffe
parentd8fc2db910a11dbbba53ba7ecf96d0e32a081076 (diff)
downloadmpd-41b4a63f2b772eba1e436c82fc9c5c9766d4470e.tar.gz
mpd-41b4a63f2b772eba1e436c82fc9c5c9766d4470e.tar.xz
mpd-41b4a63f2b772eba1e436c82fc9c5c9766d4470e.zip
decoder/ffmpeg: support FFmpeg 2.5
Version 2.5 fixed an API oddity, however it broke API compatibility, at least with C++. Disable the workaround when a libavformat version is detected that is recent enough.
-rw-r--r--NEWS2
-rw-r--r--src/decoder/FfmpegDecoderPlugin.cxx5
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index fa6bb2060..e88ef7a85 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.18.20 (not yet released)
+* decoder
+ - ffmpeg: support FFmpeg 2.5
* fix build failure with musl
ver 0.18.19 (2014/11/26)
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 69e7a6c8b..8a0937903 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -394,10 +394,15 @@ ffmpeg_probe(Decoder *decoder, InputStream &is)
avpd.filename = is.uri.c_str();
#ifdef AVPROBE_SCORE_MIME
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(56, 5, 1)
/* this attribute was added in libav/ffmpeg version 11, but
unfortunately it's "uint8_t" instead of "char", and it's
not "const" - wtf? */
avpd.mime_type = (uint8_t *)const_cast<char *>(is.GetMimeType());
+#else
+ /* API problem fixed in FFmpeg 2.5 */
+ avpd.mime_type = is.GetMimeType();
+#endif
#endif
return av_probe_input_format(&avpd, true);