mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
spa: close devices after enum
Fix error reporting and close the devices after enumerating formats.
This commit is contained in:
parent
f5f9acf84e
commit
263a017c4b
2 changed files with 45 additions and 21 deletions
|
|
@ -132,8 +132,10 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
next:
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
||||
if (*index > 0)
|
||||
return 0;
|
||||
if (*index > 0) {
|
||||
res = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
hndl = state->hndl;
|
||||
snd_pcm_hw_params_alloca(¶ms);
|
||||
|
|
@ -199,10 +201,12 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
|
|||
if ((res = spa_pod_filter(builder, result, fmt, filter)) < 0)
|
||||
goto next;
|
||||
|
||||
res = 1;
|
||||
|
||||
exit:
|
||||
if (!opened)
|
||||
spa_alsa_close(state);
|
||||
|
||||
return 1;
|
||||
return res;
|
||||
}
|
||||
|
||||
int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_t flags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue