summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-04 05:27:49 +0100
committerLennart Poettering <lennart@poettering.net>2009-03-04 05:32:26 +0100
commit341f44fa24dfff910c34e0cd8c4819e88231cff6 (patch)
treefacdcdee70303616e0b3d007af0496d77e3511b5 /src
parentecbc320a4c219b40795e0462de6f37d610003c88 (diff)
fix handling of _suspend_all(), return first failure error code
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/sink.c8
-rw-r--r--src/pulsecore/source.c11
2 files changed, 15 insertions, 4 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index ed68dd8e..667ae761 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1605,8 +1605,12 @@ int pa_sink_suspend_all(pa_core *c, pa_bool_t suspend) {
pa_core_assert_ref(c);
- for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx)))
- ret -= pa_sink_suspend(sink, suspend) < 0;
+ for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx))) {
+ int r;
+
+ if ((r = pa_sink_suspend(sink, suspend)) < 0)
+ ret = r;
+ }
return ret;
}
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 476cb553..cc6dfc40 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -955,8 +955,15 @@ int pa_source_suspend_all(pa_core *c, pa_bool_t suspend) {
pa_core_assert_ref(c);
- for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx)))
- ret -= pa_source_suspend(source, suspend) < 0;
+ for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx))) {
+ int r;
+
+ if (source->monitor_of)
+ continue;
+
+ if ((r = pa_source_suspend(source, suspend)) < 0)
+ ret = r;
+ }
return ret;
}