]> code.delx.au - pulseaudio/commitdiff
combine: Stop rate adjustments if sink is supended
authorJyri Sarha <jyri.sarha@nokia.com>
Fri, 27 Nov 2009 08:33:46 +0000 (10:33 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 6 Feb 2013 10:22:16 +0000 (12:22 +0200)
src/modules/module-combine-sink.c

index 488f69fc23bae4e630a6e96798b66a55ab8fa7af..dd38009705d6c161d3c2786948a798ef297b9a8f 100644 (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...");
 }