Commit 861dc60e authored by David Reid's avatar David Reid Committed by GitHub

Merge pull request #25 from Clownacy/master

Stop warning about uninitialised variable
parents f67f623f 16438195
...@@ -7021,18 +7021,16 @@ mal_result mal_context_get_device_info__dsound(mal_context* pContext, mal_device ...@@ -7021,18 +7021,16 @@ mal_result mal_context_get_device_info__dsound(mal_context* pContext, mal_device
if ((caps.dwFlags & MAL_DSCAPS_PRIMARYSTEREO) != 0) { if ((caps.dwFlags & MAL_DSCAPS_PRIMARYSTEREO) != 0) {
// It supports at least stereo, but could support more. // It supports at least stereo, but could support more.
pDeviceInfo->minChannels = 2; WORD channels = 2;
pDeviceInfo->maxChannels = 2;
// Look at the speaker configuration to get a better idea on the channel count. // Look at the speaker configuration to get a better idea on the channel count.
DWORD speakerConfig; DWORD speakerConfig;
if (SUCCEEDED(mal_IDirectSound_GetSpeakerConfig(pDirectSound, &speakerConfig))) { if (SUCCEEDED(mal_IDirectSound_GetSpeakerConfig(pDirectSound, &speakerConfig))) {
WORD actualChannels; mal_get_channels_from_speaker_config__dsound(speakerConfig, &channels, NULL);
mal_get_channels_from_speaker_config__dsound(speakerConfig, &actualChannels, NULL);
pDeviceInfo->minChannels = actualChannels;
pDeviceInfo->maxChannels = actualChannels;
} }
pDeviceInfo->minChannels = channels;
pDeviceInfo->maxChannels = channels;
} else { } else {
// It does not support stereo, which means we are stuck with mono. // It does not support stereo, which means we are stuck with mono.
pDeviceInfo->minChannels = 1; pDeviceInfo->minChannels = 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment