aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2019-07-03 12:32:50 +0200
committerArun Raghavan <arun@arunraghavan.net>2019-07-03 10:52:20 +0000
commit4c6bab435316768974b94573e3f67ea17f56e221 (patch)
treedf44bda736009ace597d5e637519d5f950471a21
parent1240afabfa792c1a3ba2b766c9c7bc0b3aae4b0f (diff)
downloadpulseaudio-4c6bab435316768974b94573e3f67ea17f56e221.tar.gz
sink-input: fix rewriting render memblockq when nothing should be rewound
If process_rewind() is called with nbytes = 0, process_rewind() will nevertheless request a rewrite of the render memblockq. This patch fixes the problem by adding the render memblockq length to the rewrite amount only if nbytes > 0.
-rw-r--r--src/pulsecore/sink-input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 45e005e4..d3ead2cb 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1094,7 +1094,9 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam
size_t max_rewrite, amount;
/* Calculate how much make sense to rewrite at most */
- max_rewrite = nbytes + lbq;
+ max_rewrite = nbytes;
+ if (nbytes > 0)
+ max_rewrite += lbq;
/* Transform into local domain */
if (i->thread_info.resampler)