audio/audio_comp.c: capbility channel should use collections

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2021-11-12 21:46:55 +08:00 committed by Xiang Xiao
parent 5f3aa40f10
commit 5b696559d9

View File

@ -178,7 +178,7 @@ static int audio_comp_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
int ret = -ENOTTY;
int i;
caps->ac_channels = 0;
caps->ac_channels = UINT8_MAX;
caps->ac_format.hw = UINT16_MAX;
caps->ac_controls.w = UINT32_MAX;
@ -200,7 +200,7 @@ static int audio_comp_getcaps(FAR struct audio_lowerhalf_s *dev, int type,
break;
}
if (caps->ac_channels < dup.ac_channels)
if (caps->ac_channels > dup.ac_channels)
{
caps->ac_channels = dup.ac_channels;
}