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:
parent
6f81bb4b09
commit
5f4ec7de5b
2
NEWS
2
NEWS
|
@ -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
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue