mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-22 18:15:36 +00:00
Merge pull request #70 from michaelmaltese/bugfix-57-truncate-number-of-soundflower-channels
coreaudio: obey MAX_CHANNELS when creating devices
This commit is contained in:
commit
a260961fcb
|
@ -280,7 +280,10 @@ static int from_coreaudio_layout(const AudioChannelLayout *ca_layout, struct Sou
|
|||
switch (ca_layout->mChannelLayoutTag) {
|
||||
case kAudioChannelLayoutTag_UseChannelDescriptions:
|
||||
{
|
||||
layout->channel_count = ca_layout->mNumberChannelDescriptions;
|
||||
layout->channel_count = soundio_int_min(
|
||||
SOUNDIO_MAX_CHANNELS,
|
||||
ca_layout->mNumberChannelDescriptions
|
||||
);
|
||||
for (int i = 0; i < layout->channel_count; i += 1) {
|
||||
layout->channels[i] = from_channel_descr(&ca_layout->mChannelDescriptions[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue