The PCM device numbers may be non-continous. Skip them when -ENOENT error
is returned.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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;
}