mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
alsa-sink: Do not increase watermark when requested to rewind 0 bytes
Since commit cb91d7a1 the watermark is increased when there is nothing to rewind.
This is also done in the case when there was actually no rewind requested at all,
so the watermark is increased needlessly.
This patch fixes the issue by skipping the rewind if none is requested.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/530>
This commit is contained in:
parent
169f8c5f2c
commit
015028d7e3
1 changed files with 3 additions and 0 deletions
|
|
@ -1825,6 +1825,9 @@ static int process_rewind(struct userdata *u) {
|
|||
|
||||
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
|
||||
|
||||
if (rewind_nbytes == 0)
|
||||
goto rewind_done;
|
||||
|
||||
if (PA_UNLIKELY((unused = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
|
||||
if ((err = try_recover(u, "snd_pcm_avail", (int) unused)) < 0) {
|
||||
pa_log_warn("Trying to recover from underrun failed during rewind");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue