mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:11:48 +00:00
[MMIXER] Don't stop audio devices enumeration when one or more of them failed to initialize (#7863)
Skip unsuccessfully initialized devices and continue enumeration until all of devices are enumerated. Patch by Johannes Anderwald with additional improvements from me. This fixes 0 audio devices detected for HD audio controllers (e. g., Realtek), and hence allows to properly detect all available devices and play the sound with MMixer routines enabled (they are currently default). Tested personally with Realtek HD Audio driver version R2.74 for Windows XP/Server 2003 in pair with hdaudbus.sys from Windows Vista SP2 on real hardware. CORE-17285
This commit is contained in:
parent
2ec3a199af
commit
9aa299bea4
1 changed files with 11 additions and 16 deletions
|
@ -817,11 +817,8 @@ MMixerInitialize(
|
|||
/* store mixer list */
|
||||
MixerContext->MixerContext = (PVOID)MixerList;
|
||||
|
||||
/* start enumerating all available devices */
|
||||
Count = 0;
|
||||
DeviceIndex = 0;
|
||||
|
||||
do
|
||||
/* enumerate all available devices */
|
||||
for (DeviceIndex = 0; ; DeviceIndex++)
|
||||
{
|
||||
/* enumerate a device */
|
||||
Status = EnumFunction(EnumContext, DeviceIndex, &DeviceName, &hMixer, &hKey);
|
||||
|
@ -834,29 +831,27 @@ MMixerInitialize(
|
|||
/* enumeration has finished */
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Failed to enumerate device %lu\n", DeviceIndex);
|
||||
|
||||
/* TODO cleanup */
|
||||
return Status;
|
||||
}
|
||||
DPRINT1("EnumFunction() failed for device %lu, Status %x\n", DeviceIndex, Status);
|
||||
|
||||
/* ignore error and continue */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create a mixer data entry */
|
||||
Status = MMixerCreateMixerData(MixerContext, MixerList, DeviceIndex, DeviceName, hMixer, hKey);
|
||||
if (Status != MM_STATUS_SUCCESS)
|
||||
break;
|
||||
}
|
||||
DPRINT1("MMixerCreateMixerData() failed for device %lu, Status %x\n",
|
||||
DeviceIndex, Status);
|
||||
|
||||
/* increment device index */
|
||||
DeviceIndex++;
|
||||
}while(TRUE);
|
||||
/* ignore error and continue */
|
||||
}
|
||||
}
|
||||
|
||||
/* now all filters have been pre-opened
|
||||
* lets enumerate the filters
|
||||
*/
|
||||
Count = 0;
|
||||
Entry = MixerList->MixerData.Flink;
|
||||
while(Entry != &MixerList->MixerData)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue