Commit 12ccfb3a authored by David Reid's avatar David Reid

Merge branch 'dev' of https://github.com/dr-soft/mini_al into dev

parents 78ecf63a b401f7d4
...@@ -16547,14 +16547,18 @@ mal_device_config mal_device_config_init_ex(mal_format format, mal_uint32 channe ...@@ -16547,14 +16547,18 @@ mal_device_config mal_device_config_init_ex(mal_format format, mal_uint32 channe
config.onRecvCallback = onRecvCallback; config.onRecvCallback = onRecvCallback;
config.onSendCallback = onSendCallback; config.onSendCallback = onSendCallback;
if (channelMap == NULL) { if (channels > 0) {
if (channels > 8) { if (channelMap == NULL) {
mal_zero_memory(channelMap, sizeof(mal_channel)*MAL_MAX_CHANNELS); if (channels > 8) {
mal_zero_memory(config.channelMap, sizeof(mal_channel)*MAL_MAX_CHANNELS);
} else {
mal_get_standard_channel_map(mal_standard_channel_map_default, channels, config.channelMap);
}
} else { } else {
mal_get_standard_channel_map(mal_standard_channel_map_default, channels, config.channelMap); mal_copy_memory(config.channelMap, channelMap, sizeof(config.channelMap));
} }
} else { } else {
mal_copy_memory(config.channelMap, channelMap, sizeof(config.channelMap)); mal_zero_memory(config.channelMap, sizeof(mal_channel)*MAL_MAX_CHANNELS);
} }
return config; return config;
......
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