From 511ca82e30e46baa7b94d96dbc33f97a67ea3fa4 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 21 Jan 2022 16:17:23 +0000 Subject: [PATCH] cellAVdec: constify AVCodec for ffmpeg >= 5.0 rpcs3/Emu/Cell/Modules/cellAdec.cpp:325:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_decoder(AV_CODEC_ID_ATRAC3P); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpcs3/Emu/Cell/Modules/cellAdec.cpp:331:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_decoder(AV_CODEC_ID_MP3); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpcs3/Emu/Cell/Modules/cellVdec.cpp:143:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_decoder(AV_CODEC_ID_MPEG2VIDEO); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpcs3/Emu/Cell/Modules/cellVdec.cpp:148:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_decoder(AV_CODEC_ID_H264); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpcs3/Emu/Cell/Modules/cellVdec.cpp:153:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_decoder(AV_CODEC_ID_MPEG4); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- rpcs3/Emu/Cell/Modules/cellAdec.cpp | 2 +- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellAdec.cpp b/rpcs3/Emu/Cell/Modules/cellAdec.cpp index 7a6b047641..83ef53666d 100644 --- a/rpcs3/Emu/Cell/Modules/cellAdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAdec.cpp @@ -269,7 +269,7 @@ public: bool just_started = false; bool just_finished = false; - AVCodec* codec = nullptr; + const AVCodec* codec = nullptr; AVInputFormat* input_format = nullptr; AVCodecContext* ctx = nullptr; AVFormatContext* fmt = nullptr; diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 1ef537007a..bb73ce3212 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -102,7 +102,7 @@ struct vdec_context final static const u32 id_step = 0x00000100; static const u32 id_count = 1024; - AVCodec* codec{}; + const AVCodec* codec{}; AVCodecContext* ctx{}; SwsContext* sws{};