From 54ff22b8443fcc3023ef8d384656f2f24608a2f8 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 1 Mar 2011 14:57:35 -0600 Subject: [PATCH] dsound: Also handle two-to-six-channel conversions. --- dlls/dsound/mixer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 6647e4af050..846278ef499 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -294,22 +294,29 @@ static inline void cp_fields(const IDirectSoundBufferImpl *dsb, const BYTE *ibuf INT istep = dsb->pwfx->wBitsPerSample / 8, ostep = device->pwfx->wBitsPerSample / 8; if (device->pwfx->nChannels == dsb->pwfx->nChannels || - (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 6)) { + (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 6) || + (device->pwfx->nChannels == 6 && dsb->pwfx->nChannels == 2)) { dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); - if (device->pwfx->nChannels == 2) + if (device->pwfx->nChannels == 2 || dsb->pwfx->nChannels == 2) dsb->convert(ibuf + istep, obuf + ostep, istride, ostride, count, freqAcc, adj); + return; } if (device->pwfx->nChannels == 1 && dsb->pwfx->nChannels == 2) { dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); + return; } if (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 1) { dsb->convert(ibuf, obuf, istride, ostride, count, freqAcc, adj); dsb->convert(ibuf, obuf + ostep, istride, ostride, count, freqAcc, adj); + return; } + + WARN("Unable to remap channels: device=%u, buffer=%u\n", device->pwfx->nChannels, + dsb->pwfx->nChannels); } /**