From: Giovanni Mascellani gmascellani@codeweavers.com
The mixer algorithm only supports floating-point, any other format is just unusable for us. Also, AUTOCONVERTPCM is expected to do automatic conversion anyway. --- dlls/dsound/primary.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-)
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 95e77cf4dbc..eefbf3affa3 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -115,7 +115,8 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client HRESULT hr;
if (!forcewave) { - WAVEFORMATEXTENSIBLE *mixwfe; + WAVEFORMATEXTENSIBLE *mixwfe, testwfe; + hr = IAudioClient_GetMixFormat(client, (WAVEFORMATEX**)&mixwfe);
if (FAILED(hr)) @@ -131,24 +132,15 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client mixwfe->dwChannelMask = speaker_config_to_channel_mask(device->speaker_config); }
- if (!IsEqualGUID(&mixwfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) { - WAVEFORMATEXTENSIBLE testwfe = *mixwfe; - - testwfe.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - testwfe.Samples.wValidBitsPerSample = testwfe.Format.wBitsPerSample = 32; - testwfe.Format.nBlockAlign = testwfe.Format.nChannels * testwfe.Format.wBitsPerSample / 8; - testwfe.Format.nAvgBytesPerSec = testwfe.Format.nSamplesPerSec * testwfe.Format.nBlockAlign; - - if (FAILED(IAudioClient_IsFormatSupported(client, AUDCLNT_SHAREMODE_SHARED, &testwfe.Format, (WAVEFORMATEX**)&retwfe))) - w = DSOUND_CopyFormat(&mixwfe->Format); - else if (retwfe) - w = DSOUND_CopyFormat(&retwfe->Format); - else - w = DSOUND_CopyFormat(&testwfe.Format); - CoTaskMemFree(retwfe); - retwfe = NULL; - } else - w = DSOUND_CopyFormat(&mixwfe->Format); + testwfe = *mixwfe; + + testwfe.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + testwfe.Samples.wValidBitsPerSample = testwfe.Format.wBitsPerSample = 32; + testwfe.Format.nBlockAlign = testwfe.Format.nChannels * testwfe.Format.wBitsPerSample / 8; + testwfe.Format.nAvgBytesPerSec = testwfe.Format.nSamplesPerSec * testwfe.Format.nBlockAlign; + + w = DSOUND_CopyFormat(&testwfe.Format); + CoTaskMemFree(mixwfe); } else if (device->primary_pwfx->wFormatTag == WAVE_FORMAT_PCM || device->primary_pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) {