From 2362d71d70adb8bf99e960b78a04d2ead4c8db57 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 16 Feb 2021 00:03:56 -0800 Subject: [PATCH] Mpeg: Remove deprecated codec register calls. --- Core/AVIDump.cpp | 2 ++ Core/HLE/sceAtrac.cpp | 4 ++++ Core/HLE/sceMpeg.cpp | 4 ++++ Core/HW/SimpleAudioDec.cpp | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/Core/AVIDump.cpp b/Core/AVIDump.cpp index 19cbcf1227..4e7d7f40ec 100644 --- a/Core/AVIDump.cpp +++ b/Core/AVIDump.cpp @@ -65,7 +65,9 @@ static void InitAVCodec() { static bool first_run = true; if (first_run) { #ifdef USE_FFMPEG +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 12, 100) av_register_all(); +#endif #endif first_run = false; } diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index bdaeea8b98..1c6a1fb664 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -636,8 +636,12 @@ void __AtracInit() { atracIDTypes[5] = 0; #ifdef USE_FFMPEG +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 18, 100) avcodec_register_all(); +#endif +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 12, 100) av_register_all(); +#endif #endif // USE_FFMPEG } diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index b98f57d7b4..f2dbb8a0d0 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -393,9 +393,13 @@ void __MpegInit() { actionPostPut = __KernelRegisterActionType(PostPutAction::Create); #ifdef USE_FFMPEG +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 18, 100) avcodec_register_all(); +#endif +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 12, 100) av_register_all(); #endif +#endif } void __MpegDoState(PointerWrap &p) { diff --git a/Core/HW/SimpleAudioDec.cpp b/Core/HW/SimpleAudioDec.cpp index 2e9ac873d4..12bac4ba18 100644 --- a/Core/HW/SimpleAudioDec.cpp +++ b/Core/HW/SimpleAudioDec.cpp @@ -62,8 +62,12 @@ SimpleAudio::SimpleAudio(int audioType, int sample_rate, int channels) void SimpleAudio::Init() { #ifdef USE_FFMPEG +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 18, 100) avcodec_register_all(); +#endif +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 12, 100) av_register_all(); +#endif InitFFmpeg(); frame_ = av_frame_alloc();