diff options
author | Max Kellermann <max@duempel.org> | 2014-08-13 18:40:39 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-13 18:40:39 +0200 |
commit | fe9299ceffcd9164a50214aee287fbf8e85dcd9f (patch) | |
tree | f06d8b424f753f4e6cd212d3b30d786e4fe7c85f | |
parent | c3f111a56ceacd77574af021d23b481b74bc66d4 (diff) | |
download | mpd-fe9299ceffcd9164a50214aee287fbf8e85dcd9f.tar.gz mpd-fe9299ceffcd9164a50214aee287fbf8e85dcd9f.tar.xz mpd-fe9299ceffcd9164a50214aee287fbf8e85dcd9f.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/decoder/FfmpegDecoderPlugin.cxx | 9 |
2 files changed, 11 insertions, 0 deletions
@@ -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); |