summaryrefslogtreecommitdiff
path: root/src/pulsecore/source.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/source.c
parent496be212ad645999647c432a856c906b86d41487 (diff)
core: suppress suspending/resume when we are already in the right state
Diffstat (limited to 'src/pulsecore/source.c')
-rw-r--r--src/pulsecore/source.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 4ade18f66..abb5f4d1b 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -441,6 +441,9 @@ int pa_source_suspend(pa_source *s, pa_bool_t suspend, pa_suspend_cause_t cause)
else
s->suspend_cause &= ~cause;
+ if ((pa_source_get_state(s) == PA_SOURCE_SUSPENDED) == !!s->suspend_cause)
+ return 0;
+
pa_log_debug("Suspend cause of source %s is 0x%04x, %s", s->name, s->suspend_cause, s->suspend_cause ? "suspending" : "resuming");
if (suspend)