Fix SDL audio playback with surround sound
If user has surround sound enabled, ioq3 would not play any sound. Fix painting sound buffer for 4/5.1 audio channels. Extra channels currently play no audio.
This commit is contained in:
parent
e4208cf5a7
commit
812a3dbfa5
3 changed files with 39 additions and 27 deletions
|
@ -267,14 +267,8 @@ qboolean SNDDMA_Init(void)
|
|||
if (!tmp)
|
||||
tmp = (obtained.samples * obtained.channels) * 10;
|
||||
|
||||
if (tmp & (tmp - 1)) // not a power of two? Seems to confuse something.
|
||||
{
|
||||
int val = 1;
|
||||
while (val < tmp)
|
||||
val <<= 1;
|
||||
|
||||
tmp = val;
|
||||
}
|
||||
// samples must be divisible by number of channels
|
||||
tmp -= tmp % obtained.channels;
|
||||
|
||||
dmapos = 0;
|
||||
dma.samplebits = SDL_AUDIO_BITSIZE(obtained.format);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue