mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: add extra checks
Check if the device is opened when doing _prepare or _start. When it was a follower but failed to open, we might otherwise crash. Fixes #3554
This commit is contained in:
parent
45bab72abc
commit
77651e130e
1 changed files with 5 additions and 0 deletions
|
|
@ -3020,6 +3020,9 @@ int spa_alsa_prepare(struct state *state)
|
|||
struct state *follower;
|
||||
int err;
|
||||
|
||||
if (!state->opened)
|
||||
return -EIO;
|
||||
|
||||
spa_alsa_pause(state);
|
||||
|
||||
if (state->prepared)
|
||||
|
|
@ -3052,6 +3055,8 @@ int spa_alsa_start(struct state *state)
|
|||
|
||||
if (state->started)
|
||||
return 0;
|
||||
else if (!state->opened)
|
||||
return -EIO;
|
||||
|
||||
spa_alsa_prepare(state);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue