dsound: Always fill wValidBitsPerSample.

This commit is contained in:
Andrew Eikum 2012-12-14 08:47:16 -06:00 committed by Alexandre Julliard
parent 4f32f8e185
commit 81d601f56f
1 changed files with 2 additions and 3 deletions

View File

@ -87,10 +87,9 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client
WAVEFORMATEXTENSIBLE testwfe = *mixwfe;
testwfe.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
testwfe.Format.wBitsPerSample = 32;
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;
testwfe.Samples.wValidBitsPerSample = 0;
if (FAILED(IAudioClient_IsFormatSupported(client, AUDCLNT_SHAREMODE_SHARED, &testwfe.Format, (WAVEFORMATEX**)&retwfe)))
w = DSOUND_CopyFormat(&mixwfe->Format);
@ -121,12 +120,12 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client
w->nAvgBytesPerSec = w->nSamplesPerSec * w->nBlockAlign;
wfe->dwChannelMask = 0;
wfe->Samples.wValidBitsPerSample = 0;
if (wi->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) {
w->wBitsPerSample = 32;
wfe->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
} else
wfe->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
wfe->Samples.wValidBitsPerSample = w->wBitsPerSample;
} else
w = DSOUND_CopyFormat(device->primary_pwfx);