From fe9299ceffcd9164a50214aee287fbf8e85dcd9f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Aug 2014 18:40:39 +0200 Subject: [PATCH 1/2] decoder/ffmpeg: use avcodec_descriptor_get() to determine codec name In version 11, both ffmpeg and libav deprecate AVCodecContext::codec_name. The function avcodec_descriptor_get() has been introduced long ago. --- NEWS | 2 ++ src/decoder/FfmpegDecoderPlugin.cxx | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 8d0ddc1ff..e28d2f121 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.18.13 (not yet released) +* decoder + - ffmpeg: support ffmpeg/libav version 11 ver 0.18.12 (2014/07/30) * database diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx index bcb1ae3c9..5133f91ac 100644 --- a/src/decoder/FfmpegDecoderPlugin.cxx +++ b/src/decoder/FfmpegDecoderPlugin.cxx @@ -433,9 +433,18 @@ ffmpeg_decode(Decoder &decoder, InputStream &input) AVStream *av_stream = format_context->streams[audio_stream]; AVCodecContext *codec_context = av_stream->codec; + +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 25, 0) + const AVCodecDescriptor *codec_descriptor = + avcodec_descriptor_get(codec_context->codec_id); + if (codec_descriptor != nullptr) + FormatDebug(ffmpeg_domain, "codec '%s'", + codec_descriptor->name); +#else if (codec_context->codec_name[0] != 0) FormatDebug(ffmpeg_domain, "codec '%s'", codec_context->codec_name); +#endif AVCodec *codec = avcodec_find_decoder(codec_context->codec_id); From 40280fa6cf7dc1e45724c3e965e1eeab03b3994e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 15 Aug 2014 21:22:37 +0200 Subject: [PATCH 2/2] util: Fix header for strcasecmp According to POSIX and both OSX and Linux manpages, strcasecmp comes from strings.h, not string.h. Most OSes also have them available in string.h, but we just fixed the headers on Haiku and it now only provides them in strings.h. We might want to fall back to string.h for other OSes though... cf. http://pubs.opengroup.org/onlinepubs/009695399/functions/strcasecmp.html http://linux.die.net/man/3/strcasecmp https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strcasecmp.3.html --- src/util/ASCII.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/ASCII.hxx b/src/util/ASCII.hxx index adea6dceb..19a18a1bb 100644 --- a/src/util/ASCII.hxx +++ b/src/util/ASCII.hxx @@ -33,7 +33,7 @@ #include "Compiler.h" #include -#include +#include /** * Determine whether two strings are equal, ignoring case for ASCII