mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa: fix device enumeration
This commit is contained in:
parent
4808f8f10e
commit
28389e05f3
2 changed files with 10 additions and 2 deletions
|
|
@ -127,10 +127,12 @@ spa_alsa_enum_format (SpaALSAState *state,
|
|||
SpaPODProp *prop;
|
||||
SpaFormat *fmt;
|
||||
SpaResult res;
|
||||
bool opened;
|
||||
|
||||
if (index == 1)
|
||||
return SPA_RESULT_ENUM_END;
|
||||
|
||||
opened = state->opened;
|
||||
if ((err = spa_alsa_open (state)) < 0)
|
||||
return SPA_RESULT_ERROR;
|
||||
|
||||
|
|
@ -204,6 +206,8 @@ spa_alsa_enum_format (SpaALSAState *state,
|
|||
return res;
|
||||
|
||||
*format = SPA_POD_BUILDER_DEREF (&b, 0, SpaFormat);
|
||||
if (!opened)
|
||||
spa_alsa_close (state);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue