Skip to content

Commit

Permalink
Naruto 3: Probably a better fix for the video hang issue.
Browse files Browse the repository at this point in the history
Fixes #9591, replaces #11772
  • Loading branch information
hrydgard committed Feb 9, 2019
1 parent bff58d0 commit 4e70287
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Core/HLE/sceMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ static int sceMpegGetAvcAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr)
avcAu.read(auAddr);

if (ringbuffer->packetsRead == 0 || ringbuffer->packetsAvail == 0) {
DEBUG_LOG(ME, "ERROR_MPEG_NO_DATA=sceMpegGetAvcAu(%08x, %08x, %08x, %08x)", mpeg, streamId, auAddr, attrAddr);
WARN_LOG(ME, "ERROR_MPEG_NO_DATA=sceMpegGetAvcAu(%08x, %08x, %08x, %08x)", mpeg, streamId, auAddr, attrAddr);
avcAu.pts = -1;
avcAu.dts = -1;
avcAu.write(auAddr);
Expand Down Expand Up @@ -1664,6 +1664,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;
Expand Down Expand Up @@ -1694,7 +1695,11 @@ static int sceMpegGetAtracAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr)
Memory::Write_U32(0, attrAddr);
}

DEBUG_LOG(ME, "%x=sceMpegGetAtracAu(%08x, %08x, %08x, %08x)", result, mpeg, streamId, auAddr, attrAddr);
if (result == 0) {
DEBUG_LOG(ME, "%x=sceMpegGetAtracAu(%08x, %08x, %08x, %08x)", result, mpeg, streamId, auAddr, attrAddr);
} else {
WARN_LOG(ME, "%x=sceMpegGetAtracAu(%08x, %08x, %08x, %08x)", result, mpeg, streamId, auAddr, attrAddr);
}
// TODO: Not clear on exactly when this delays.
return hleDelayResult(result, "mpeg get atrac", 100);
}
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceMpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4e70287

Please sign in to comment.