summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index fadbb857..667ae761 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
@@ -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;
@@ -1529,8 +1532,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;
@@ -1600,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;
}
@@ -1730,7 +1739,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 +1760,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;