combine: Stop rate adjustments if sink is supended

This commit is contained in:
Jyri Sarha 2009-11-27 10:33:46 +02:00 committed by Tanu Kaskinen
parent 163a7dbe8b
commit a3b8b6a07e

View file

@ -252,7 +252,11 @@ static void time_callback(pa_mainloop_api *a, pa_time_event *e, const struct tim
adjust_rates(u);
pa_core_rttime_restart(u->core, e, pa_rtclock_now() + u->adjust_time);
if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED) {
u->core->mainloop->time_free(e);
u->time_event = NULL;
} else
pa_core_rttime_restart(u->core, e, pa_rtclock_now() + u->adjust_time);
}
static void process_render_null(struct userdata *u, pa_usec_t now) {
@ -603,6 +607,9 @@ static void unsuspend(struct userdata *u) {
PA_IDXSET_FOREACH(o, u->outputs, idx)
output_enable(o);
if (!u->time_event)
u->time_event = pa_core_rttime_new(u->core, pa_rtclock_now() + u->adjust_time, time_callback, u);
pa_log_info("Resumed successfully...");
}