Robert Reif wrote:
> Fix mixer detection for multiple sound cards.
>
>
>
This fixes a bug with the previous patch
and adds some more debugging info.
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 21 Aug 2005 11:29:12 -0000
@@ -366,8 +366,8 @@ static DWORD MIX_Open(WORD wDevID, LPMIX
* the equivalent of mixer identification
* (with a reference to a wave, midi.. handle
*/
- if (!(mix = MIX_Get(wDevID))) {
- WARN("bad device ID\n");
+ if ((mix = MIX_Get(wDevID)) == NULL) {
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -610,8 +610,8 @@ static DWORD MIX_GetDevCaps(WORD wDevID,
return MMSYSERR_INVALPARAM;
}
- if (!(mix = MIX_Get(wDevID))) {
- WARN("bad device ID\n");
+ if ((mix = MIX_Get(wDevID)) == NULL) {
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -787,7 +787,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID
}
if ((mix = MIX_Get(wDevID)) == NULL) {
- WARN("bad device ID\n");
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -969,7 +969,7 @@ static DWORD MIX_GetLineControls(WORD wD
}
if ((mix = MIX_Get(wDevID)) == NULL) {
- WARN("bad device id\n");
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -1068,7 +1068,7 @@ static DWORD MIX_GetControlDetails(WORD
}
if ((mix = MIX_Get(wDevID)) == NULL) {
- WARN("bad device ID\n");
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -1266,7 +1266,7 @@ static DWORD MIX_SetControlDetails(WORD
}
if ((mix = MIX_Get(wDevID)) == NULL) {
- WARN("bad device ID\n");
+ WARN("bad device ID: %04X\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
@@ -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_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 */
+ MIX_Open(MIX_NumMixers - 1, NULL, 0); /* FIXME */
} else {
WARN("couldn't open %s\n", name);
}