Skip to content

Commit

Permalink
Mpeg: Initialize esBuffer to safer values.
Browse files Browse the repository at this point in the history
Makes the audio work properly in Dan Ball Senki W (#4786.)
  • Loading branch information
unknownbrackets committed Jan 17, 2016
1 parent c03f6c2 commit 74d4011
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Core/HLE/sceMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,15 +1320,19 @@ static int sceMpegInitAu(u32 mpeg, u32 bufferAddr, u32 auPointer)

if (bufferAddr >= 1 && bufferAddr <= (u32)MPEG_DATA_ES_BUFFERS && ctx->esBuffers[bufferAddr - 1]) {
// This esbuffer has been allocated for Avc.
sceAu.esBuffer = bufferAddr; // Can this be right??? not much of a buffer pointer..
// Default to 0, since we stuff the stream id in here. Technically, we shouldn't.
// TODO: Do something better to track the AU data. This used to be bufferAddr.
sceAu.esBuffer = 0;
sceAu.esSize = MPEG_AVC_ES_SIZE;
sceAu.dts = 0;
sceAu.pts = 0;

sceAu.write(auPointer);
} else {
// This esbuffer has been left as Atrac.
sceAu.esBuffer = bufferAddr;
// Default to 0, since we stuff the stream id in here. Technically, we shouldn't.
// TODO: Do something better to track the AU data. This used to be bufferAddr.
sceAu.esBuffer = 0;
sceAu.esSize = MPEG_ATRAC_ES_SIZE;
sceAu.pts = 0;
sceAu.dts = UNKNOWN_TIMESTAMP;
Expand Down

0 comments on commit 74d4011

Please sign in to comment.