summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-07 23:58:45 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-07 23:58:45 +0200
commit7d4916379bbf05384ad199004949cc220822aa5f (patch)
treeee2a106d411a9f6039d917041f2dbc45f34b8014 /src/pulsecore
parent51b3899348bf29dd88b56691aeea9f57895dfd14 (diff)
ladspa/remap: make sure we process all requested rewinds unconditionally
In some situations a rewind request travelling downstream might be optimized away on its way and an upstream rewind processing might never come back. Hence, call _process_rewind() before each _render()just to make sure we processed them all.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sink.c7
-rw-r--r--src/pulsecore/source.c6
2 files changed, 8 insertions, 5 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 73a70625..5e9662c2 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -665,11 +665,14 @@ void pa_sink_move_all_fail(pa_queue *q) {
void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
pa_sink_input *i;
void *state = NULL;
+
pa_sink_assert_ref(s);
pa_assert(PA_SINK_IS_LINKED(s->thread_info.state));
/* If nobody requested this and this is actually no real rewind
- * then we can short cut this */
+ * then we can short cut this. Please note that this means that
+ * not all rewind requests triggered upstream will always be
+ * translated in actual requests! */
if (!s->thread_info.rewind_requested && nbytes <= 0)
return;
@@ -682,7 +685,7 @@ void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
if (nbytes > 0)
pa_log_debug("Processing rewind...");
- while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL))) {
+ PA_HASHMAP_FOREACH(i, s->thread_info.inputs, state) {
pa_sink_input_assert_ref(i);
pa_sink_input_process_rewind(i, nbytes);
}
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index ad7462b1..b8af148f 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -592,15 +592,15 @@ void pa_source_process_rewind(pa_source *s, size_t nbytes) {
pa_source_assert_ref(s);
pa_assert(PA_SOURCE_IS_LINKED(s->thread_info.state));
- if (s->thread_info.state == PA_SOURCE_SUSPENDED)
+ if (nbytes <= 0)
return;
- if (nbytes <= 0)
+ if (s->thread_info.state == PA_SOURCE_SUSPENDED)
return;
pa_log_debug("Processing rewind...");
- while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL))) {
+ PA_HASHMAP_FOREACH(o, s->thread_info.outputs, state) {
pa_source_output_assert_ref(o);
pa_source_output_process_rewind(o, nbytes);
}