From 6bc3cb4dfabdebdd7f872ebc0b30966988bc73c0 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Fri, 29 Jan 2021 22:26:45 +0800 Subject: [PATCH] Mpeg:Only allow firmware >= 3 for warmup Fix #13996 --- Core/HLE/sceMpeg.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 298f2423d9..acd9a2a657 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -34,6 +34,7 @@ #include "Core/Reporting.h" #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" +#include "CORE/HLE/sceKernelMemory.h" // MPEG AVC elementary stream. static const int MPEG_AVC_ES_SIZE = 2048; // MPEG packet size. @@ -1584,8 +1585,8 @@ static int sceMpegGetAvcAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) ERROR_LOG_REPORT(ME, "sceMpegGetAvcAu(%08x, %08x, %08x, %08x): invalid ringbuffer address", mpeg, streamId, auAddr, attrAddr); return -1; } - - if (ctx->mpegwarmUp < MPEG_WARMUP_FRAMES) { + int sdkver = sceKernelGetCompiledSdkVersion(); + if ((sdkver >= 0x03000000) && (ctx->mpegwarmUp < MPEG_WARMUP_FRAMES)) { DEBUG_LOG(ME, "sceMpegGetAvcAu(%08x, %08x, %08x, %08x): warming up", mpeg, streamId, auAddr, attrAddr); ctx->mpegwarmUp++; return ERROR_MPEG_NO_DATA; @@ -1686,12 +1687,6 @@ static int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) return -1; } - if (ctx->mpegwarmUp < MPEG_WARMUP_FRAMES) { - DEBUG_LOG(ME, "sceMpegGetAtracAu(%08x, %08x, %08x, %08x): warming up", mpeg, streamId, auAddr, attrAddr); - ctx->mpegwarmUp++; - return ERROR_MPEG_NO_DATA; - } - SceMpegAu atracAu; atracAu.read(auAddr);