mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-17 21:41:45 -04:00
alsa: clear output and log file after doing alsa API
Also be a bit more careful when the handles are NULL.
This commit is contained in:
parent
91755950dd
commit
eadaa2608a
1 changed files with 8 additions and 5 deletions
|
|
@ -1068,7 +1068,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
|
||||||
|
|
||||||
int spa_alsa_clear(struct state *state)
|
int spa_alsa_clear(struct state *state)
|
||||||
{
|
{
|
||||||
int err;
|
int err = 0;
|
||||||
struct state *follower;
|
struct state *follower;
|
||||||
|
|
||||||
spa_list_remove(&state->link);
|
spa_list_remove(&state->link);
|
||||||
|
|
@ -1094,10 +1094,6 @@ int spa_alsa_clear(struct state *state)
|
||||||
state->card = NULL;
|
state->card = NULL;
|
||||||
state->card_index = SPA_ID_INVALID;
|
state->card_index = SPA_ID_INVALID;
|
||||||
|
|
||||||
if ((err = snd_output_close(state->output)) < 0)
|
|
||||||
spa_log_warn(state->log, "output close failed: %s", snd_strerror(err));
|
|
||||||
fclose(state->log_file);
|
|
||||||
|
|
||||||
free(state->tag[0]);
|
free(state->tag[0]);
|
||||||
free(state->tag[1]);
|
free(state->tag[1]);
|
||||||
|
|
||||||
|
|
@ -1121,6 +1117,13 @@ int spa_alsa_clear(struct state *state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state->output) {
|
||||||
|
if ((err = snd_output_close(state->output)) < 0)
|
||||||
|
spa_log_warn(state->log, "output close failed: %s", snd_strerror(err));
|
||||||
|
}
|
||||||
|
if (state->log_file)
|
||||||
|
fclose(state->log_file);
|
||||||
|
|
||||||
spa_clear_ptr(state->alsa_chmap, free);
|
spa_clear_ptr(state->alsa_chmap, free);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue