mirror of https://github.com/snes9xgit/snes9x.git
win32: make sure sample count is even
This commit is contained in:
parent
1fb5d790e3
commit
a76837a4f2
|
@ -314,7 +314,8 @@ bool CDirectSound::InitSoundBuffer()
|
|||
blockCount = 4;
|
||||
blockTime = GUI.SoundBufferSize / blockCount;
|
||||
|
||||
blockSamples = (Settings.SoundPlaybackRate * blockTime * (Settings.Stereo ? 2 : 1)) / 1000;
|
||||
blockSamples = (Settings.SoundPlaybackRate * blockTime) / 1000;
|
||||
blockSamples *= (Settings.Stereo ? 2 : 1);
|
||||
blockSize = blockSamples * (Settings.SixteenBitSound ? 2 : 1);
|
||||
bufferSize = blockSize * blockCount;
|
||||
|
||||
|
|
|
@ -355,7 +355,8 @@ bool CXAudio2::SetupSound()
|
|||
blockCount = 8;
|
||||
UINT32 blockTime = GUI.SoundBufferSize / blockCount;
|
||||
|
||||
singleBufferSamples = (Settings.SoundPlaybackRate * blockTime * (Settings.Stereo ? 2 : 1)) / 1000;
|
||||
singleBufferSamples = (Settings.SoundPlaybackRate * blockTime) / 1000;
|
||||
singleBufferSamples *= (Settings.Stereo ? 2 : 1);
|
||||
singleBufferBytes = singleBufferSamples * (Settings.SixteenBitSound ? 2 : 1);
|
||||
sum_bufferSize = singleBufferBytes * blockCount;
|
||||
|
||||
|
|
Loading…
Reference in New Issue