mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: keep states in global list
This commit is contained in:
parent
c915f2a6fd
commit
86f1d14b72
2 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
|||
#include "alsa-pcm.h"
|
||||
|
||||
static struct spa_list cards = SPA_LIST_INIT(&cards);
|
||||
static struct spa_list states = SPA_LIST_INIT(&states);
|
||||
|
||||
static struct card *find_card(uint32_t index)
|
||||
{
|
||||
|
|
@ -501,6 +502,8 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
|
|||
int err;
|
||||
const char *str;
|
||||
|
||||
spa_list_append(&states, &state->link);
|
||||
|
||||
snd_config_update_free_global();
|
||||
|
||||
if ((str = spa_dict_lookup(info, "device.profile.pro")) != NULL)
|
||||
|
|
@ -557,6 +560,7 @@ int spa_alsa_clear(struct state *state)
|
|||
{
|
||||
int err;
|
||||
|
||||
spa_list_remove(&state->link);
|
||||
release_card(state->card);
|
||||
|
||||
state->card = NULL;
|
||||
|
|
|
|||
|
|
@ -225,6 +225,8 @@ struct state {
|
|||
snd_ctl_t *ctl;
|
||||
snd_ctl_elem_value_t *pitch_elem;
|
||||
double last_rate;
|
||||
|
||||
struct spa_list link;
|
||||
};
|
||||
|
||||
struct spa_pod *spa_alsa_enum_propinfo(struct state *state,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue