mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
move direct sound specific behavior into the actual direct sound function instead of into an ifdef
This commit is contained in:
parent
ae27874cf1
commit
9b9ba165e0
@ -26,11 +26,5 @@
|
||||
|
||||
int PSPMixer::Mix(short *stereoout, int numSamples)
|
||||
{
|
||||
int numFrames = __AudioMix(stereoout, numSamples);
|
||||
#ifdef _WIN32
|
||||
// Our dsound backend will not stop playing.
|
||||
//__AudioMix fills the rest of the buffer with 0 already
|
||||
numFrames = numSamples;
|
||||
#endif
|
||||
return numFrames;
|
||||
return __AudioMix(stereoout, numSamples);
|
||||
}
|
||||
|
@ -128,15 +128,13 @@ namespace DSound
|
||||
dsBuffer->GetCurrentPosition((DWORD *)¤tPos, 0);
|
||||
int numBytesToRender = RoundDown128(ModBufferSize(currentPos - lastPos));
|
||||
|
||||
//renderStuff(numBytesToRender/2);
|
||||
//if (numBytesToRender>bufferSize/2) numBytesToRender=0;
|
||||
|
||||
if (numBytesToRender >= 256)
|
||||
{
|
||||
int numBytesRendered = 4 * (*callback)(realtimeBuffer, numBytesToRender >> 2, 16, 44100, 2);
|
||||
|
||||
if (numBytesRendered != 0)
|
||||
writeDataToBuffer(lastPos, (char *)realtimeBuffer, numBytesRendered);
|
||||
//We need to copy the full buffer, regardless of what the mixer claims to have filled
|
||||
//If we don't do this then the sound will loop if the sound stops and the mixer writes only zeroes
|
||||
numBytesRendered = numBytesToRender;
|
||||
writeDataToBuffer(lastPos, (char *) realtimeBuffer, numBytesRendered);
|
||||
|
||||
currentPos = ModBufferSize(lastPos + numBytesRendered);
|
||||
totalRenderedBytes += numBytesRendered;
|
||||
@ -144,7 +142,6 @@ namespace DSound
|
||||
lastPos = currentPos;
|
||||
}
|
||||
|
||||
|
||||
LeaveCriticalSection(&soundCriticalSection);
|
||||
WaitForSingleObject(soundSyncEvent, MAXWAIT);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user