[WINEOSS] multiple sound card mixer patch

Robert Reif reif at earthlink.net
Sat Aug 20 15:09:22 CDT 2005


Fix mixer detection for multiple sound cards.
-------------- next part --------------
Index: dlls/winmm/wineoss/mixer.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/wineoss/mixer.c,v
retrieving revision 1.35
diff -p -u -r1.35 mixer.c
--- dlls/winmm/wineoss/mixer.c	3 Aug 2005 21:25:10 -0000	1.35
+++ dlls/winmm/wineoss/mixer.c	20 Aug 2005 20:06:26 -0000
@@ -1457,8 +1457,8 @@ static	DWORD	MIX_Init(void)
 #ifdef SOUND_MIXER_INFO
             mixer_info info;
             if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) {
-                MIX_Mixers[i].name = HeapAlloc(GetProcessHeap(),0,strlen(info.name) + 1);
-                strcpy(MIX_Mixers[i].name, info.name);
+                MIX_Mixers[MIX_NumMixers].name = HeapAlloc(GetProcessHeap(),0,strlen(info.name) + 1);
+                strcpy(MIX_Mixers[MIX_NumMixers].name, info.name);
             } else {
                 /* FreeBSD up to at least 5.2 provides this ioctl, but does not
                  * implement it properly, and there are probably similar issues
@@ -1469,10 +1469,10 @@ static	DWORD	MIX_Init(void)
 #endif
             close(mixer);
 
+            MIX_Mixers[MIX_NumMixers].dev_name = HeapAlloc(GetProcessHeap(),0,strlen(name) + 1);
+            strcpy(MIX_Mixers[MIX_NumMixers].dev_name, name);
+            MIX_Open(MIX_NumMixers, NULL, 0); /* FIXME */
             MIX_NumMixers++;
-            MIX_Mixers[i].dev_name = HeapAlloc(GetProcessHeap(),0,strlen(name) + 1);
-            strcpy(MIX_Mixers[i].dev_name, name);
-            MIX_Open(i, NULL, 0); /* FIXME */
         } else {
             WARN("couldn't open %s\n", name);
         }


More information about the wine-patches mailing list