Andrew Eikum : dsound: Also handle two-to-six-channel conversions.

Alexandre Julliard julliard at winehq.org
Wed Mar 2 12:23:48 CST 2011


Module: wine
Branch: master
Commit: 54ff22b8443fcc3023ef8d384656f2f24608a2f8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=54ff22b8443fcc3023ef8d384656f2f24608a2f8

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Tue Mar  1 14:57:35 2011 -0600

dsound: Also handle two-to-six-channel conversions.

---

 dlls/dsound/mixer.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index 6647e4a..846278e 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);
 }
 
 /**




More information about the wine-cvs mailing list