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.
This commit is contained in:
Max Kellermann 2014-12-08 14:25:34 +01:00
parent d8fc2db910
commit 41b4a63f2b
2 changed files with 7 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.18.20 (not yet released) ver 0.18.20 (not yet released)
* decoder
- ffmpeg: support FFmpeg 2.5
* fix build failure with musl * fix build failure with musl
ver 0.18.19 (2014/11/26) ver 0.18.19 (2014/11/26)

View File

@ -394,10 +394,15 @@ ffmpeg_probe(Decoder *decoder, InputStream &is)
avpd.filename = is.uri.c_str(); avpd.filename = is.uri.c_str();
#ifdef AVPROBE_SCORE_MIME #ifdef AVPROBE_SCORE_MIME
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(56, 5, 1)
/* this attribute was added in libav/ffmpeg version 11, but /* this attribute was added in libav/ffmpeg version 11, but
unfortunately it's "uint8_t" instead of "char", and it's unfortunately it's "uint8_t" instead of "char", and it's
not "const" - wtf? */ not "const" - wtf? */
avpd.mime_type = (uint8_t *)const_cast<char *>(is.GetMimeType()); 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 #endif
return av_probe_input_format(&avpd, true); return av_probe_input_format(&avpd, true);