/* Called from main thread */
pa_bool_t pa_source_update_rate(pa_source *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;
return FALSE;
pa_log_debug("Suspending source %s due to changing the sample rate.", s->name);
- pa_source_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
+ pa_source_suspend(s, TRUE, PA_SUSPEND_INTERNAL);
if (s->update_rate(s, desired_rate) == TRUE) {
pa_log_info("Changed sampling rate successfully ");
if (o->state == PA_SOURCE_OUTPUT_CORKED)
pa_source_output_update_rate(o);
}
- return TRUE;
+ ret = TRUE;
}
+
+ pa_source_suspend(s, FALSE, PA_SUSPEND_INTERNAL);
}
- return FALSE;
+
+ return ret;
}
/* Called from main thread */