From 891d223a4fe60185833309cac111c2c65c858f2b Mon Sep 17 00:00:00 2001 From: raven02 Date: Sun, 9 Feb 2014 21:48:26 +0800 Subject: [PATCH 1/2] Avoid repeat spamming of audio end reach --- Core/HLE/sceMpeg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index a93af17e5..91e6fd45e 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1165,18 +1165,18 @@ int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) } int result = 0; - atracAu.pts = ctx->mediaengine->getAudioTimeStamp() + ctx->mpegFirstTimestamp; + if (ctx->mediaengine->IsVideoEnd()) { INFO_LOG(ME, "video end reach. pts: %i dts: %i", (int)atracAu.pts, (int)ctx->mediaengine->getLastTimeStamp()); mpegRingbuffer.packetsFree = mpegRingbuffer.packets; Memory::WriteStruct(ctx->mpegRingbufferAddr, &mpegRingbuffer); - result = ERROR_MPEG_NO_DATA; } - if (ctx->mediaengine->IsNoAudioData()) { - INFO_LOG(ME, "Audio end reach. pts: %i dts: %i", (int)atracAu.pts, (int)ctx->mediaengine->getLastTimeStamp()); + if (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; result = ERROR_MPEG_NO_DATA; } From 1fcbc4681441d12607f91f3300b2fd24eee340dc Mon Sep 17 00:00:00 2001 From: raven02 Date: Mon, 10 Feb 2014 09:31:54 +0800 Subject: [PATCH 2/2] Make sure audio stream is present --- Core/HLE/sceMpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 91e6fd45e..e17f0b3c0 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1174,7 +1174,7 @@ int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr) result = ERROR_MPEG_NO_DATA; } - if (ctx->mediaengine->IsNoAudioData() && !ctx->endOfAudioReached) { + 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; result = ERROR_MPEG_NO_DATA;