From 86dee05aec330a0c2886c0327712153793ca46c4 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 3 Mar 2009 20:23:02 +0000 Subject: Use LGPL 2.1 on all files previously using LGPL 2 --- src/pulsecore/source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pulsecore/source.c') diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 4ce5cbfe..52777164 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -6,7 +6,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, + by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but -- cgit From bffa8be8cd208fbc4d3cd44c34be47e9e47b086f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Mar 2009 05:25:41 +0100 Subject: Don't allow suspending of monitor sources. Closes #499 --- src/pulsecore/source.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pulsecore/source.c') diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 52777164..f946366d 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -424,6 +424,9 @@ int pa_source_suspend(pa_source *s, pa_bool_t suspend) { pa_source_assert_ref(s); pa_assert(PA_SOURCE_IS_LINKED(s->state)); + if (s->monitor_of) + return -PA_ERR_NOTSUPPORTED; + if (suspend) return source_set_state(s, PA_SOURCE_SUSPENDED); else -- cgit From ecbc320a4c219b40795e0462de6f37d610003c88 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Mar 2009 05:27:14 +0100 Subject: make suspend state of monitor source follow the suspend state of the sink it belongs to --- src/pulsecore/source.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/pulsecore/source.c') diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index f946366d..476cb553 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -433,6 +433,24 @@ int pa_source_suspend(pa_source *s, pa_bool_t suspend) { return source_set_state(s, pa_source_used_by(s) ? PA_SOURCE_RUNNING : PA_SOURCE_IDLE); } +/* Called from main context */ +int pa_source_sync_suspend(pa_source *s) { + pa_sink_state_t state; + + pa_source_assert_ref(s); + pa_assert(PA_SOURCE_IS_LINKED(s->state)); + pa_assert(s->monitor_of); + + state = pa_sink_get_state(s->monitor_of); + + if (state == PA_SINK_SUSPENDED) + return source_set_state(s, PA_SOURCE_SUSPENDED); + + pa_assert(PA_SINK_IS_OPENED(state)); + + return source_set_state(s, pa_source_used_by(s) ? PA_SOURCE_RUNNING : PA_SOURCE_IDLE); +} + /* Called from main context */ pa_queue *pa_source_move_all_start(pa_source *s) { pa_queue *q; -- cgit From 341f44fa24dfff910c34e0cd8c4819e88231cff6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Mar 2009 05:27:49 +0100 Subject: fix handling of _suspend_all(), return first failure error code --- src/pulsecore/source.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/source.c') 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; } -- cgit