summaryrefslogtreecommitdiffstats
path: root/src/modules/module-ladspa-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-26 19:43:45 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-26 19:43:45 +0200
commit9f0afb391a0748b2e1e78d5b19f1af48a249a674 (patch)
tree65edabd90e9624cd96adf0108befb52325bb91c9 /src/modules/module-ladspa-sink.c
parentd08cac0f8545d493812f83111166458c6248dc45 (diff)
always forward rewind requests to the sink, and don't abort on nbytes=0
Diffstat (limited to 'src/modules/module-ladspa-sink.c')
-rw-r--r--src/modules/module-ladspa-sink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 3e0babfa..eae80086 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -217,16 +217,16 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
/* Called from I/O thread context */
static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
struct userdata *u;
+ size_t amount = 0;
pa_sink_input_assert_ref(i);
pa_assert_se(u = i->userdata);
- pa_assert(nbytes > 0);
if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state))
return;
if (u->sink->thread_info.rewind_nbytes > 0) {
- size_t max_rewrite, amount;
+ size_t max_rewrite;
max_rewrite = nbytes + pa_memblockq_get_length(u->memblockq);
amount = PA_MIN(u->sink->thread_info.rewind_nbytes, max_rewrite);
@@ -236,7 +236,6 @@ static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
unsigned c;
pa_memblockq_seek(u->memblockq, - (int64_t) amount, PA_SEEK_RELATIVE);
- pa_sink_process_rewind(u->sink, amount);
pa_log_debug("Resetting plugin");
@@ -250,6 +249,7 @@ static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
}
}
+ pa_sink_process_rewind(u->sink, amount);
pa_memblockq_rewind(u->memblockq, nbytes);
}