Skip to content

Commit

Permalink
[WDMAUD.DRV] Pass the correct additional data size to I/O control req…
Browse files Browse the repository at this point in the history
…uest

Store a correct size of additional data in WAVEFORMATEX.cbSize when performing open of audio device, when WAVE_FORMAT_EXTENSIBLE audio format is used.
It allows to properly open audio device with Legacy APIs enabled too.
This fixes audio playback in several apps those are using extensible audio data (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium based browsers, GameDevTycoon Demo game etc.).
CORE-10907, CORE-14783
  • Loading branch information
oleg-dubinskiy committed Apr 1, 2024
1 parent a96d0e7 commit dc1feaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dll/win32/wdmaud.drv/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ WdmAudSetWaveDeviceFormatByLegacy(
ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO));
DeviceInfo.DeviceType = DeviceType;
DeviceInfo.DeviceIndex = DeviceId;
DeviceInfo.u.WaveFormatEx.cbSize = sizeof(WAVEFORMATEX); //WaveFormat->cbSize;
DeviceInfo.u.WaveFormatEx.cbSize = WaveFormat->cbSize;
DeviceInfo.u.WaveFormatEx.wFormatTag = WaveFormat->wFormatTag;
#ifdef USERMODE_MIXER
DeviceInfo.u.WaveFormatEx.nChannels = 2;
Expand Down Expand Up @@ -546,7 +546,7 @@ WdmAudSetWaveDeviceFormatByLegacy(
}

/* store details */
Instance->WaveFormatEx.cbSize = sizeof(WAVEFORMATEX);
Instance->WaveFormatEx.cbSize = WaveFormat->cbSize;
Instance->WaveFormatEx.wBitsPerSample = (DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec * 8) / (DeviceInfo.u.WaveFormatEx.nSamplesPerSec * DeviceInfo.u.WaveFormatEx.nChannels);

/* Store sound device handle instance handle */
Expand Down

0 comments on commit dc1feaf

Please sign in to comment.