From ecf62a03adc909d001c3fc6de7b887c998969bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 9 Feb 2019 09:56:59 +0100 Subject: [PATCH] Naruto 3: Probably a better fix for the video hang issue. Fixes #9591, replaces #11772 --- .gitignore | 2 +- Core/HLE/sceMpeg.cpp | 2 +- Core/HLE/sceMpeg.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b0bc906ca8df..e391987ab129 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ desc.txt Logs Memstick -memstick +memstick* Cheats /git-version.cpp diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index e6bd1e0680d4..a76a216fa496 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1599,7 +1599,6 @@ static int sceMpegGetAvcAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) Memory::Write_U32(1, attrAddr); } - DEBUG_LOG(ME, "%x=sceMpegGetAvcAu(%08x, %08x, %08x, %08x)", result, mpeg, streamId, auAddr, attrAddr); // TODO: sceMpegGetAvcAu seems to modify esSize, and delay when it's > 1000 or something. // There's definitely more to it, but ultimately it seems games should expect it to delay randomly. @@ -1664,6 +1663,7 @@ static int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) // Instead, let's abuse it to keep track of the stream number. if (streamInfo != ctx->streamMap.end()) { atracAu.esBuffer = streamInfo->second.num; + ctx->mediaengine->setAudioStream(streamInfo->second.num); } int result = 0; diff --git a/Core/HLE/sceMpeg.h b/Core/HLE/sceMpeg.h index ca310bf4097d..bf5b0dfcced0 100644 --- a/Core/HLE/sceMpeg.h +++ b/Core/HLE/sceMpeg.h @@ -49,7 +49,7 @@ static const int PSMF_AUDIO_STREAM_ID = 0xBD; struct SceMpegAu { s64_le pts; // presentation time stamp s64_le dts; // decode time stamp - u32_le esBuffer; + u32_le esBuffer; // WARNING: We abuse this to keep track of the stream number! u32_le esSize; void read(u32 addr);