Merge pull request #1014 from unknownbrackets/ios

iOS: fix significant audio stutter
This commit is contained in:
Henrik Rydgård 2013-03-17 11:52:55 -07:00
commit 89717a67bf
2 changed files with 3 additions and 2 deletions

View File

@ -273,5 +273,5 @@ int __AudioMix(short *outstereo, int numFrames)
// DEBUG_LOG(HLE, "No underrun, mixed %i samples fine", numFrames);
}
section.unlock();
return numFrames;
return underrun >= 0 ? underrun : numFrames;
}

View File

@ -133,7 +133,8 @@ namespace DSound
{
int numBytesRendered = 4 * (*callback)(realtimeBuffer,numBytesToRender>>2,16,44100,2);
writeDataToBuffer(lastPos,(char *)realtimeBuffer,numBytesRendered);
if (numBytesRendered != 0)
writeDataToBuffer(lastPos,(char *)realtimeBuffer,numBytesRendered);
currentPos = ModBufferSize(lastPos + numBytesRendered);
totalRenderedBytes += numBytesRendered;