From f70f05668fc419dc241eaaf44c64e6cd68a1f9e6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 24 Sep 2016 17:54:40 -0700 Subject: [PATCH] Mpeg: Return errors when no audio is available. Before, we were only returning an error once, in an effort to log only once. This meant sometimes games would not realize they needed to add packets. Un-reverted from e866d83. No longer breaks Patapon with other mpeg fixes. --- Core/HLE/sceMpeg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index c9aa9a7f34..13ea3921be 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1660,12 +1660,18 @@ static int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) if (ctx->mediaengine->IsVideoEnd()) { INFO_LOG(ME, "video end reach. pts: %i dts: %i", (int)atracAu.pts, (int)ctx->mediaengine->getLastTimeStamp()); ringbuffer->packetsAvail = 0; + // TODO: Is this correct? + if (!ctx->mediaengine->IsNoAudioData()) { + WARN_LOG_REPORT(ME, "Video end without audio end, potentially skipping some audio?"); + } result = ERROR_MPEG_NO_DATA; } if (ctx->atracRegistered && ctx->mediaengine->IsNoAudioData() && !ctx->endOfAudioReached) { WARN_LOG(ME, "Audio end reach. pts: %i dts: %i", (int)atracAu.pts, (int)ctx->mediaengine->getLastTimeStamp()); ctx->endOfAudioReached = true; + } + if (ctx->mediaengine->IsNoAudioData()) { result = ERROR_MPEG_NO_DATA; }