Merge pull request #19450 from hrydgard/the-warriors-compat
Some checks failed
Build / build (./b.sh --headless --unittest, clang, clang++, test, clang-normal, ubuntu-latest) (push) Failing after 1s
Build / build (./b.sh --headless --unittest, gcc, g++, gcc-normal, ubuntu-latest) (push) Failing after 1s
Build / build (./b.sh --libretro_android ppsspp_libretro, clang, clang++, android, android-libretro, ubuntu-latest) (push) Failing after 1s
Build / build (./b.sh --qt, gcc, g++, qt, qt, ubuntu-latest) (push) Failing after 1s
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a OPENXR=1, clang, clang++, android, android-vr, ubuntu-latest) (push) Failing after 1s
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm64, ubuntu-latest) (push) Failing after 1s
Build / build (cd android && ./ab.sh -j2 APP_ABI=armeabi-v7a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm32, ubuntu-latest) (push) Failing after 1s
Build / build (cd android && ./ab.sh -j2 APP_ABI=x86_64 UNITTEST=1 HEADLESS=1, clang, clang++, android, android-x86_64, ubuntu-latest) (push) Failing after 1s
Build / build (make -C libretro -f Makefile -j2, clang, clang++, libretro, clang-libretro, ubuntu-latest) (push) Failing after 1s
Build / build (make -C libretro -f Makefile -j2, gcc, g++, libretro, gcc-libretro, ubuntu-latest) (push) Failing after 1s
Build / build_test_headless_alpine (push) Failing after 1s
Generate Docker Layer / build (push) Failing after 1s
Build / build-windows (ARM64) (push) Has been cancelled
Build / build-windows (x64) (push) Has been cancelled
Build / build-uwp (push) Has been cancelled
Build / build (./b.sh --headless --unittest --fat --no-png --no-sdl2, clang, clang++, test, macos, macos-latest) (push) Has been cancelled
Build / build (./b.sh --ios, clang, clang++, ios, ios, macos-latest) (push) Has been cancelled
Build / test-windows (push) Has been cancelled
Build / test (macos-latest) (push) Has been cancelled
Build / test (ubuntu-latest) (push) Has been cancelled

Port over LunaMoo's compat flag for The Warriors video playback
This commit is contained in:
Henrik Rydgård 2024-09-11 15:39:13 +02:00 committed by GitHub
commit 17fc508535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 1 deletions

View File

@ -140,6 +140,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "FramebufferAllowLargeVerticalOffset", &flags_.FramebufferAllowLargeVerticalOffset);
CheckSetting(iniFile, gameID, "DisableMemcpySlicing", &flags_.DisableMemcpySlicing);
CheckSetting(iniFile, gameID, "ForceEnableGPUReadback", &flags_.ForceEnableGPUReadback);
CheckSetting(iniFile, gameID, "UseFFMPEGFindStreamInfo", &flags_.UseFFMPEGFindStreamInfo);
}
void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) {

View File

@ -110,6 +110,7 @@ struct CompatFlags {
bool FramebufferAllowLargeVerticalOffset;
bool DisableMemcpySlicing;
bool ForceEnableGPUReadback;
bool UseFFMPEGFindStreamInfo;
};
struct VRCompat {

View File

@ -18,6 +18,7 @@
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/Math/CrossSIMD.h"
#include "Core/Config.h"
#include "Core/Core.h"
#include "Core/Debugger/MemBlockInfo.h"
#include "Core/HW/MediaEngine.h"
#include "Core/MemMap.h"
@ -303,7 +304,8 @@ bool MediaEngine::openContext(bool keepReadPos) {
}
av_dict_free(&open_opt);
if (!SetupStreams()) {
bool usedFFMPEGFindStreamInfo = false;
if (!SetupStreams() || PSP_CoreParameter().compat.flags().UseFFMPEGFindStreamInfo) {
// Fallback to old behavior. Reads too much and corrupts when game doesn't read fast enough.
// SetupStreams sometimes work for newer FFmpeg 3.1+ now, but sometimes framerate is missing.
WARN_LOG_REPORT_ONCE(setupStreams, Log::ME, "Failed to read valid video stream data from header");
@ -311,6 +313,7 @@ bool MediaEngine::openContext(bool keepReadPos) {
closeContext();
return false;
}
usedFFMPEGFindStreamInfo = true;
}
if (m_videoStream >= (int)m_pFormatCtx->nb_streams) {
@ -342,6 +345,11 @@ bool MediaEngine::openContext(bool keepReadPos) {
setVideoDim();
m_audioContext = CreateAudioDecoder((PSPAudioType)m_audioType);
m_isVideoEnd = false;
if (PSP_CoreParameter().compat.flags().UseFFMPEGFindStreamInfo && usedFFMPEGFindStreamInfo) {
m_mpegheaderReadPos++;
av_seek_frame(m_pFormatCtx, m_videoStream, 0, 0);
}
#endif // USE_FFMPEG
return true;
}

View File

@ -1364,6 +1364,11 @@ UCET00278 = true
UCUS98670 = true
UCUS98646 = true
[UseFFMPEGFindStreamInfo]
# The Warriors: Works around regression (#8991) by reverting to the old behavior
ULUS10213 = true
ULES00483 = true
[ForceLowerResolutionForEffectsOn]
# The water effect of DiRT 2 and Outrun doesn't work in higher resolutions.