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.
This commit is contained in:
Georg Chini 2019-07-03 12:32:50 +02:00 committed by Arun Raghavan
parent 1240afabfa
commit 4c6bab4353

View file

@ -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; size_t max_rewrite, amount;
/* Calculate how much make sense to rewrite at most */ /* 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 */ /* Transform into local domain */
if (i->thread_info.resampler) if (i->thread_info.resampler)