[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-153-g03aa91d
Lennart Poettering
gitmailer-noreply at 0pointer.de
Sun Dec 21 09:04:38 PST 2008
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 606c9caa0b07ab0c8f18438a3fe24db2213188b5 (commit)
- Log -----------------------------------------------------------------
03aa91d... make sure we don't hit an assert when we issue two rewind requests in a single iteration
-----------------------------------------------------------------------
Summary of changes:
src/pulsecore/sink-input.c | 42 +++++++++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 17 deletions(-)
-----------------------------------------------------------------------
commit 03aa91dea735a38aa0c3a581ede315b736ecc25b
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Dec 21 17:55:29 2008 +0100
make sure we don't hit an assert when we issue two rewind requests in a
single iteration
Closes rhbz 472757.
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index d4e0a9c..d25cd79 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1194,7 +1194,8 @@ void pa_sink_input_request_rewind(pa_sink_input *i, size_t nbytes /* in our sam
* implementor. This implies 'flush' is TRUE. */
pa_sink_input_assert_ref(i);
- pa_assert(i->thread_info.rewrite_nbytes == 0);
+
+ nbytes = PA_MAX(i->thread_info.rewrite_nbytes, nbytes);
/* pa_log_debug("request rewrite %lu", (unsigned long) nbytes); */
@@ -1222,26 +1223,33 @@ void pa_sink_input_request_rewind(pa_sink_input *i, size_t nbytes /* in our sam
nbytes = pa_resampler_request(i->thread_info.resampler, nbytes);
}
- if (rewrite) {
- /* Make sure to not overwrite over underruns */
- if (nbytes > i->thread_info.playing_for)
- nbytes = (size_t) i->thread_info.playing_for;
+ if (i->thread_info.rewrite_nbytes != (size_t) -1) {
+ if (rewrite) {
+ /* Make sure to not overwrite over underruns */
+ if (nbytes > i->thread_info.playing_for)
+ nbytes = (size_t) i->thread_info.playing_for;
- i->thread_info.rewrite_nbytes = nbytes;
- } else
- i->thread_info.rewrite_nbytes = (size_t) -1;
+ i->thread_info.rewrite_nbytes = nbytes;
+ } else
+ i->thread_info.rewrite_nbytes = (size_t) -1;
+ }
- i->thread_info.rewrite_flush = flush && i->thread_info.rewrite_nbytes != 0;
+ i->thread_info.rewrite_flush =
+ i->thread_info.rewrite_flush ||
+ (flush && i->thread_info.rewrite_nbytes != 0);
- /* Transform to sink domain */
- if (i->thread_info.resampler)
- nbytes = pa_resampler_result(i->thread_info.resampler, nbytes);
+ if (nbytes != (size_t) -1) {
- if (nbytes > lbq)
- pa_sink_request_rewind(i->sink, nbytes - lbq);
- else
- /* This call will make sure process_rewind() is called later */
- pa_sink_request_rewind(i->sink, 0);
+ /* Transform to sink domain */
+ if (i->thread_info.resampler)
+ nbytes = pa_resampler_result(i->thread_info.resampler, nbytes);
+
+ if (nbytes > lbq)
+ pa_sink_request_rewind(i->sink, nbytes - lbq);
+ else
+ /* This call will make sure process_rewind() is called later */
+ pa_sink_request_rewind(i->sink, 0);
+ }
}
/* Called from main context */
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list