From 2fde87b074de1028fa3d1bf2d04be480ed879734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 1 May 2025 22:55:50 +0200 Subject: [PATCH] Revert some const changes Fixes #20307 --- Core/HW/MediaEngine.cpp | 7 +++---- Core/HW/MediaEngine.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 96b54e5ab2..8e77d1b0b1 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -343,8 +343,7 @@ bool MediaEngine::openContext(bool keepReadPos) { return true; } -void MediaEngine::closeContext() -{ +void MediaEngine::closeContext() { #ifdef USE_FFMPEG if (m_buffer) av_free(m_buffer); @@ -356,7 +355,7 @@ void MediaEngine::closeContext() av_free(m_pIOContext->buffer); if (m_pIOContext) av_free(m_pIOContext); - for (const auto &it : m_pCodecCtxs) { + for (auto &it : m_pCodecCtxs) { #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100) avcodec_free_context(&it.second); #else @@ -365,7 +364,7 @@ void MediaEngine::closeContext() } m_pCodecCtxs.clear(); // These are streams allocated from avformat_new_stream. - for (const auto &it : m_codecsToClose) { + for (auto &it : m_codecsToClose) { avcodec_close(it); } m_codecsToClose.clear(); diff --git a/Core/HW/MediaEngine.h b/Core/HW/MediaEngine.h index e0a54c1343..f3564ec97b 100644 --- a/Core/HW/MediaEngine.h +++ b/Core/HW/MediaEngine.h @@ -113,7 +113,7 @@ public: // TODO: Very little of this below should be public. int m_desWidth = 0; int m_desHeight = 0; - int m_bufSize; + int m_bufSize; // initialized in constructor s64 m_videopts = 0; s64 m_firstTimeStamp = 0;