diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-11-03 10:29:20 +0100 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-11-03 10:29:20 +0100 |
commit | eeab4efa98238940e40792c01b8e23ad73233a2b (patch) | |
tree | 51e8c214a78e8e730e5efc84e87a83cdbf24910d | |
parent | 5bc6cadcb2e7255fd333ed88cc80b61a7673ddd9 (diff) |
Revert "core: adjust playing_for and underrun_for at rewind"
This reverts commit 5bc6cadcb2e7255fd333ed88cc80b61a7673ddd9.
I wasn't meaning to push this out - just merged for review / testing.
-rw-r--r-- | src/pulsecore/sink-input.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 1eb47511..7a7575a9 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -970,15 +970,6 @@ void pa_sink_input_drop(pa_sink_input *i, size_t nbytes /* in sink sample spec * pa_memblockq_drop(i->thread_info.render_memblockq, nbytes); } -static void subtract_helper(size_t *p, size_t amount) -{ - if (*p == (size_t) -1) - return; - if (*p < amount) - *p = 0; - *p -= amount; -} - /* Called from thread context */ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sample spec */) { size_t lbq; @@ -1005,12 +996,8 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam /* We were asked to drop all buffered data, and rerequest new * data from implementor the next time peek() is called */ - size_t s = pa_memblockq_get_length(i->thread_info.render_memblockq); - if (i->thread_info.resampler) - s = pa_resampler_request(i->thread_info.resampler, s); pa_memblockq_flush_write(i->thread_info.render_memblockq, TRUE); - subtract_helper(&i->thread_info.underrun_for, s); - subtract_helper(&i->thread_info.playing_for, s); + } else if (i->thread_info.rewrite_nbytes > 0) { size_t max_rewrite, amount; @@ -1025,8 +1012,6 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam amount = PA_MIN(i->thread_info.rewrite_nbytes, max_rewrite); if (amount > 0) { - size_t samount = amount; - pa_log_debug("Have to rewind %lu bytes on implementor.", (unsigned long) amount); /* Tell the implementor */ @@ -1036,14 +1021,11 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam /* Convert back to to sink domain */ if (i->thread_info.resampler) - samount = pa_resampler_result(i->thread_info.resampler, amount); + amount = pa_resampler_result(i->thread_info.resampler, amount); - if (samount > 0) { + if (amount > 0) /* Ok, now update the write pointer */ - pa_memblockq_seek(i->thread_info.render_memblockq, - ((int64_t) samount), PA_SEEK_RELATIVE, TRUE); - subtract_helper(&i->thread_info.underrun_for, amount); - subtract_helper(&i->thread_info.playing_for, amount); - } + pa_memblockq_seek(i->thread_info.render_memblockq, - ((int64_t) amount), PA_SEEK_RELATIVE, TRUE); if (i->thread_info.rewrite_flush) pa_memblockq_silence(i->thread_info.render_memblockq); |