decoder/ffmpeg, lib/ffmpeg: make AVCodec pointers "const"

For libavcodec 59 support.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1333
This commit is contained in:
Max Kellermann 2021-11-09 21:07:11 +01:00
parent 6f81bb4b09
commit 5f4ec7de5b
3 changed files with 4 additions and 2 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.23.4 (not yet released) ver 0.23.4 (not yet released)
* decoder
- ffmpeg: support libavcodec 59
* output * output
- alsa: add option "thesycon_dsd_workaround" to work around device bug - alsa: add option "thesycon_dsd_workaround" to work around device bug
* fix crash on debug builds if startup fails * fix crash on debug builds if startup fails

View File

@ -502,7 +502,7 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
FmtDebug(ffmpeg_domain, "codec '{}'", FmtDebug(ffmpeg_domain, "codec '{}'",
codec_descriptor->name); codec_descriptor->name);
AVCodec *codec = avcodec_find_decoder(codec_params.codec_id); const AVCodec *codec = avcodec_find_decoder(codec_params.codec_id);
if (!codec) { if (!codec) {
LogError(ffmpeg_domain, "Unsupported audio codec"); LogError(ffmpeg_domain, "Unsupported audio codec");

View File

@ -36,7 +36,7 @@ class CodecContext {
public: public:
CodecContext() = default; CodecContext() = default;
explicit CodecContext(AVCodec &codec) explicit CodecContext(const AVCodec &codec)
:codec_context(avcodec_alloc_context3(&codec)) :codec_context(avcodec_alloc_context3(&codec))
{ {
if (codec_context == nullptr) if (codec_context == nullptr)