mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: Make sure we handle errors in close
When a device is removed, close() will error. Warn about this but continue closing our other things including marking the device as closed so that we don't try to close it again later. Fixes #413
This commit is contained in:
parent
38fcc64e1f
commit
b055b9de25
1 changed files with 6 additions and 2 deletions
|
|
@ -74,11 +74,15 @@ int spa_alsa_close(struct state *state)
|
|||
return 0;
|
||||
|
||||
spa_log_debug(state->log, NAME" %p: Device '%s' closing", state, state->props.device);
|
||||
CHECK(snd_pcm_close(state->hndl), "%s: close failed", state->props.device);
|
||||
if ((err = snd_pcm_close(state->hndl)) < 0)
|
||||
spa_log_warn(state->log, "%s: close failed: %s", state->props.device,
|
||||
snd_strerror(err));
|
||||
|
||||
CHECK(snd_output_close(state->output), "output close failed");
|
||||
if ((err = snd_output_close(state->output)) < 0)
|
||||
spa_log_warn(state->log, "output close failed: %s", snd_strerror(err));
|
||||
|
||||
spa_system_close(state->data_system, state->timerfd);
|
||||
|
||||
state->opened = false;
|
||||
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue