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/sink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pulsecore/sink.c') diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index fadbb857..298cc881 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.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 946d07211ba3ab814183b2112b89e557edb12159 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Mar 2009 02:51:30 +0100 Subject: document more closely from which context certain functions may be called --- src/pulsecore/sink.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pulsecore/sink.c') diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 298cc881..11334037 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -1529,8 +1529,10 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse s->thread_info.state = PA_PTR_TO_UINT(userdata); - if (s->thread_info.state == PA_SINK_SUSPENDED) + if (s->thread_info.state == PA_SINK_SUSPENDED) { + s->thread_info.rewind_nbytes = 0; s->thread_info.rewind_requested = FALSE; + } return 0; @@ -1730,7 +1732,7 @@ pa_usec_t pa_sink_get_requested_latency(pa_sink *s) { return usec; } -/* Called from IO thread */ +/* Called from IO as well as the main thread -- the latter only before the IO thread started up */ void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind) { pa_sink_input *i; void *state = NULL; @@ -1751,7 +1753,7 @@ void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind) { pa_source_set_max_rewind(s->monitor_source, s->thread_info.max_rewind); } -/* Called from IO thread */ +/* Called from IO as well as the main thread -- the latter only before the IO thread started up */ void pa_sink_set_max_request(pa_sink *s, size_t max_request) { void *state = NULL; -- 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/sink.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pulsecore/sink.c') diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 11334037..ed68dd8e 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -326,6 +326,9 @@ static int sink_set_state(pa_sink *s, pa_sink_state_t state) { pa_sink_input_kill(i); else if (i->suspend) i->suspend(i, state == PA_SINK_SUSPENDED); + + if (s->monitor_source) + pa_source_sync_suspend(s->monitor_source); } return 0; -- 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/sink.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/sink.c') 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; } -- cgit