summaryrefslogtreecommitdiff
path: root/src/modules
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
parentd08cac0f8545d493812f83111166458c6248dc45 (diff)
always forward rewind requests to the sink, and don't abort on nbytes=0
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-ladspa-sink.c6
-rw-r--r--src/modules/module-remap-sink.c9
2 files changed, 6 insertions, 9 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);
}
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index c87b1ece..bd86f4d6 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -152,24 +152,21 @@ 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) {
+ size_t amount = 0;
struct userdata *u;
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 amount;
-
amount = PA_MIN(u->sink->thread_info.rewind_nbytes, nbytes);
u->sink->thread_info.rewind_nbytes = 0;
-
- if (amount > 0)
- pa_sink_process_rewind(u->sink, amount);
}
+
+ pa_sink_process_rewind(u->sink, amount);
}
/* Called from I/O thread context */