[pulseaudio-discuss] [PATCH 1/3] loopback: Cork sink-input if source is suspended

Frédéric Dalleau frederic.dalleau at linux.intel.com
Thu May 3 09:17:39 PDT 2012


---
 src/modules/module-loopback.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 6016787..ca3affd 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -389,6 +389,17 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
     pa_proplist_free(p);
 }
 
+/* Called from main thread */
+static void source_output_suspend_cb(pa_source_output *o, pa_bool_t suspended) {
+    struct userdata *u;
+
+    pa_source_output_assert_ref(o);
+    pa_assert_ctl_context();
+    pa_assert_se(u = o->userdata);
+
+    pa_sink_input_cork(u->sink_input, suspended);
+}
+
 /* Called from output thread context */
 static void update_min_memblockq_length(struct userdata *u) {
     size_t length;
@@ -833,6 +844,7 @@ int pa__init(pa_module *m) {
     u->source_output->state_change = source_output_state_change_cb;
     u->source_output->may_move_to = source_output_may_move_to_cb;
     u->source_output->moving = source_output_moving_cb;
+    u->source_output->suspend = source_output_suspend_cb;
     u->source_output->userdata = u;
 
     pa_source_output_set_requested_latency(u->source_output, u->latency/3);
-- 
1.7.5.4



More information about the pulseaudio-discuss mailing list