]> code.delx.au - pulseaudio/commitdiff
loopback: Fix cork state not updated after move
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Mon, 1 Jul 2013 08:27:21 +0000 (10:27 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Mon, 8 Jul 2013 14:53:28 +0000 (17:53 +0300)
The source output and sink inputs should be corked if the corresponding
sink/source is suspended, as handled during module initialization. This
also needs to be handled during stream move, because the suspend state
of the destination sink/source might be different to the previous one.

This fixes the issue with an infinite number of "Requesting rewind due
to end of underrun" traces after a stream move.

src/modules/module-loopback.c

index 5876f9dbc7d3593854f8b189ab4e6897a8bb35c5..e24ded584fe968b0b0190702ff2cf6bfa3834985 100644 (file)
@@ -419,6 +419,13 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
 
     pa_sink_input_update_proplist(u->sink_input, PA_UPDATE_REPLACE, p);
     pa_proplist_free(p);
+
+    if (pa_source_get_state(dest) == PA_SOURCE_SUSPENDED)
+        pa_sink_input_cork(u->sink_input, true);
+    else
+        pa_sink_input_cork(u->sink_input, false);
+
+    update_adjust_timer(u);
 }
 
 /* Called from main thread */
@@ -684,6 +691,13 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
 
     pa_source_output_update_proplist(u->source_output, PA_UPDATE_REPLACE, p);
     pa_proplist_free(p);
+
+    if (pa_sink_get_state(dest) == PA_SINK_SUSPENDED)
+        pa_source_output_cork(u->source_output, true);
+    else
+        pa_source_output_cork(u->source_output, false);
+
+    update_adjust_timer(u);
 }
 
 /* Called from main thread */