Author: janderwald
Date: Fri Dec 3 11:14:29 2010
New Revision: 49917
URL:
http://svn.reactos.org/svn/reactos?rev=49917&view=rev
Log:
[AUDIO-BRINGUP]
- Fix opening of mixer / midi devices
Modified:
branches/audio-bringup/lib/drivers/sound/mmebuddy/mmewrap.c
branches/audio-bringup/lib/drivers/sound/mmebuddy/wave/format.c
Modified: branches/audio-bringup/lib/drivers/sound/mmebuddy/mmewrap.c
URL:
http://svn.reactos.org/svn/reactos/branches/audio-bringup/lib/drivers/sound…
==============================================================================
--- branches/audio-bringup/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original)
+++ branches/audio-bringup/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Fri Dec 3
11:14:29 2010
@@ -130,11 +130,11 @@
UINT Message;
PSOUND_DEVICE SoundDevice;
PSOUND_DEVICE_INSTANCE SoundDeviceInstance;
- LPWAVEFORMATEX Format;
+ LPWAVEFORMATEX Format = NULL;
SND_TRACE(L"Opening device");
- VALIDATE_MMSYS_PARAMETER( IS_WAVE_DEVICE_TYPE(DeviceType) ); /* FIXME? wave in
too? */
+ VALIDATE_MMSYS_PARAMETER( IS_WAVE_DEVICE_TYPE(DeviceType) ||
IS_MIXER_DEVICE_TYPE(DeviceType) || IS_MIDI_DEVICE_TYPE(DeviceType) ); /* FIXME? wave
in too? */
VALIDATE_MMSYS_PARAMETER( OpenParameters );
Result = GetSoundDevice(DeviceType, DeviceId, &SoundDevice);
Modified: branches/audio-bringup/lib/drivers/sound/mmebuddy/wave/format.c
URL:
http://svn.reactos.org/svn/reactos/branches/audio-bringup/lib/drivers/sound…
==============================================================================
--- branches/audio-bringup/lib/drivers/sound/mmebuddy/wave/format.c [iso-8859-1]
(original)
+++ branches/audio-bringup/lib/drivers/sound/mmebuddy/wave/format.c [iso-8859-1] Fri Dec
3 11:14:29 2010
@@ -65,8 +65,6 @@
SND_TRACE(L"Setting wave format\n");
VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
- VALIDATE_MMSYS_PARAMETER( Format );
- VALIDATE_MMSYS_PARAMETER( FormatSize >= sizeof(WAVEFORMATEX) );
Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice);
if ( ! MMSUCCESS(Result) )
@@ -74,9 +72,14 @@
Result = GetSoundDeviceType(SoundDevice, &DeviceType);
SND_ASSERT( Result == MMSYSERR_NOERROR );
+ if (DeviceType == WAVE_IN_DEVICE_TYPE || DeviceType == WAVE_OUT_DEVICE_TYPE)
+ {
+ VALIDATE_MMSYS_PARAMETER( Format );
+ VALIDATE_MMSYS_PARAMETER( FormatSize >= sizeof(WAVEFORMATEX) );
+ }
/* Ensure we have a wave device (TODO: check if this applies to wavein as well) */
- VALIDATE_MMSYS_PARAMETER( IS_WAVE_DEVICE_TYPE(DeviceType) );
+ VALIDATE_MMSYS_PARAMETER( IS_WAVE_DEVICE_TYPE(DeviceType) ||
IS_MIDI_DEVICE_TYPE(DeviceType) || IS_MIXER_DEVICE_TYPE(DeviceType));
/* Obtain the function table */
Result = GetSoundDeviceFunctionTable(SoundDevice, &FunctionTable);