mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-16 08:56:40 -05:00
alsa-sink: Avoid unloading alsa-sink module before calling try_recover()
This fixes rare condition when pulseaudio client tries to rewind, but a device previously reached underrun and was changed to XRUN state.
This commit is contained in:
parent
a6bc996dc1
commit
f621aa5e2c
1 changed files with 4 additions and 2 deletions
|
|
@ -1628,8 +1628,10 @@ static int process_rewind(struct userdata *u) {
|
||||||
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
|
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
|
||||||
|
|
||||||
if (PA_UNLIKELY((unused = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
|
if (PA_UNLIKELY((unused = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
|
||||||
pa_log("snd_pcm_avail() failed: %s", pa_alsa_strerror((int) unused));
|
if (try_recover(u, "snd_pcm_avail", (int) unused) < 0) {
|
||||||
return -1;
|
pa_log_warn("Trying to recover from underrun failed during rewind");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unused_nbytes = (size_t) unused * u->frame_size;
|
unused_nbytes = (size_t) unused * u->frame_size;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue