Fix SDL audio playback with 16-bit stereo sound

My commit last month "Fix SDL audio playback with surround sound" broke
16-bit stereo sound. S_TransferStereo16() still assumed that dma.samples
was a power of two. I also cleaned up code related to the previously
mentioned commit.
This commit is contained in:
Zack Middleton 2018-10-01 21:28:15 -05:00
parent 93dd14c9fb
commit 58b0fb07cd
4 changed files with 17 additions and 20 deletions

View file

@ -272,6 +272,7 @@ qboolean SNDDMA_Init(void)
dma.isfloat = SDL_AUDIO_ISFLOAT(obtained.format);
dma.channels = obtained.channels;
dma.samples = tmp;
dma.fullsamples = dma.samples / dma.channels;
dma.submission_chunk = 1;
dma.speed = obtained.freq;
dmasize = (dma.samples * (dma.samplebits/8));