summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-06 15:31:46 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-06 15:31:46 +0200
commit69eab1e057e000951516cfd381846c33abc8aaf1 (patch)
tree607f15ee997fecf9714485fea7c28aee4e29590d /src/pulsecore/sink.c
parent496be212ad645999647c432a856c906b86d41487 (diff)
core: suppress suspending/resume when we are already in the right state
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 3c4adc6c..a087e42d 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -510,6 +510,9 @@ int pa_sink_suspend(pa_sink *s, pa_bool_t suspend, pa_suspend_cause_t cause) {
else
s->suspend_cause &= ~cause;
+ if ((pa_sink_get_state(s) == PA_SINK_SUSPENDED) == !!s->suspend_cause)
+ return 0;
+
pa_log_debug("Suspend cause of sink %s is 0x%04x, %s", s->name, s->suspend_cause, s->suspend_cause ? "suspending" : "resuming");
if (s->suspend_cause)