[pulseaudio-discuss] [PATCH v0] loopback: Fix cork state not updated after move

Mikel Astiz mikel.astiz.oss at gmail.com
Mon Jul 1 01:27:21 PDT 2013


From: Mikel Astiz <mikel.astiz at bmw-carit.de>

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 | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 4a32af4..9f897e0 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -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 */
-- 
1.8.1.4



More information about the pulseaudio-discuss mailing list