alsa-pcm: try to recover in all cases

Even if we can't get the current status, still try to recover the
device.

See #347
This commit is contained in:
Wim Taymans 2020-10-22 09:16:45 +02:00
parent 398dc3055b
commit c1ea63fa7a

View file

@ -620,7 +620,7 @@ static int alsa_recover(struct state *state, int err)
if (SPA_UNLIKELY((res = snd_pcm_status(state->hndl, status)) < 0)) {
spa_log_error(state->log, NAME" %p: snd_pcm_status error: %s",
state, snd_strerror(res));
return res;
goto recover;
}
st = snd_pcm_status_get_state(status);
@ -652,6 +652,7 @@ static int alsa_recover(struct state *state, int err)
break;
}
recover:
if (SPA_UNLIKELY((res = snd_pcm_recover(state->hndl, err, true)) < 0)) {
spa_log_error(state->log, NAME" %p: snd_pcm_recover error: %s",
state, snd_strerror(res));