summaryrefslogtreecommitdiff
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 451247092..1522e60b2 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1337,6 +1337,8 @@ void pa_sink_render_full(pa_sink *s, size_t length, pa_memchunk *result) {
/* Called from main thread */
pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough)
{
+ pa_bool_t ret = FALSE;
+
if (s->update_rate) {
uint32_t desired_rate = rate;
uint32_t default_rate = s->default_sample_rate;
@@ -1395,7 +1397,7 @@ pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough)
if (!passthrough && pa_sink_used_by(s) > 0)
return FALSE;
- pa_sink_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
+ pa_sink_suspend(s, TRUE, PA_SUSPEND_INTERNAL);
if (s->update_rate(s, desired_rate) == TRUE) {
/* update monitor source as well */
@@ -1408,10 +1410,13 @@ pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough)
pa_sink_input_update_rate(i);
}
- return TRUE;
+ ret = TRUE;
}
+
+ pa_sink_suspend(s, FALSE, PA_SUSPEND_INTERNAL);
}
- return FALSE;
+
+ return ret ;
}
/* Called from main thread */