mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Merge pull request #25 from Clownacy/master
Stop warning about uninitialised variable
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user