From e3be3d5f7b0ed7fff6cfbdfb2d7b820e123cfc2f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 18 Feb 2021 00:08:00 -0800 Subject: [PATCH] Mpeg: Clarify fallback problems. Also, modify it in case some packager was patching, so they see this. --- Core/HW/MediaEngine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 7d3ccee417..f8f008f73d 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -313,8 +313,10 @@ bool MediaEngine::openContext(bool keepReadPos) { av_dict_free(&open_opt); if (!SetupStreams()) { - // Fallback to old behavior. - if (avformat_find_stream_info(m_pFormatCtx, NULL) < 0) { + // Fallback to old behavior. Reads too much and corrupts when game doesn't read fast enough. + // SetupStreams should work for newer FFmpeg 3.1+ now. + WARN_LOG_REPORT_ONCE(setupStreams, ME, "Failed to read valid video stream data from header"); + if (avformat_find_stream_info(m_pFormatCtx, nullptr) < 0) { closeContext(); return false; }