[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] alsa-sink: Do not increase watermark when requested to rewind 0 bytes

PulseAudio Marge Bot gitlab at gitlab.freedesktop.org
Thu Mar 25 02:32:21 UTC 2021



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
015028d7 by Georg Chini at 2021-03-25T02:29:42+00: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>

- - - - -


1 changed file:

- src/modules/alsa/alsa-sink.c


Changes:

=====================================
src/modules/alsa/alsa-sink.c
=====================================
@@ -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");



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/015028d7e33ebc5c0fb84877296a9a5aefa603c3

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/015028d7e33ebc5c0fb84877296a9a5aefa603c3
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210325/0f8f2e0f/attachment.htm>


More information about the pulseaudio-commits mailing list