mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-11-30 03:00:33 +00:00
ucm: fixed find-device substitution (non-continuous PCM devices)
The PCM device numbers may be non-continous. Skip them when -ENOENT error is returned. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
652ddf866f
commit
508506a80c
@ -380,12 +380,15 @@ static struct lookup_iterate *rval_pcm_lookup1(struct lookup_iterate *iter,
|
||||
snd_ctl_t *ctl = iter->ctl_list->ctl;
|
||||
int err;
|
||||
|
||||
next:
|
||||
if (snd_ctl_pcm_next_device(ctl, &device) < 0 || device < 0)
|
||||
return NULL;
|
||||
pcminfo = iter->info;
|
||||
snd_pcm_info_set_device(pcminfo, device);
|
||||
err = snd_ctl_pcm_info(ctl, pcminfo);
|
||||
if (err < 0) {
|
||||
if (err == -ENOENT)
|
||||
goto next;
|
||||
uc_error("Unable to obtain PCM info (device %d)", device);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user