8000 Stop warning about uninitialised variable by Clownacy · Pull Request #25 · mackron/miniaudio · GitHub
[go: up one dir, main page]

Skip to content
8000
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions mini_al.h
Original file line number Diff line number Diff line change
Expand Up @@ -7021,18 +7021,16 @@ mal_result mal_context_get_device_info__dsound(mal_context* pContext, mal_device

if ((caps.dwFlags & MAL_DSCAPS_PRIMARYSTEREO) != 0) {
// It supports at least stereo, but could support more.
pDeviceInfo->minChannels = 2;
pDeviceInfo->maxChannels = 2;
WORD channels = 2;

// Look at the speaker configuration to get a better idea on the channel count.
DWORD speakerConfig;
if (SUCCEEDED(mal_IDirectSound_GetSpeakerConfig(pDirectSound, &speakerConfig))) {
WORD actualChannels;
mal_get_channels_from_speaker_config__dsound(speakerConfig, &actualChannels, NULL);

pDeviceInfo->minChannels = actualChannels;
pDeviceInfo->maxChannels = actualChannels;
mal_get_channels_from_speaker_config__dsound(speakerConfig, &channels, NULL);
}

pDeviceInfo->minChannels = channels;
pDeviceInfo->maxChannels = channels;
} else {
// It does not support stereo, which means we are stuck with mono.
pDeviceInfo->minChannels = 1;
Expand Down
0