[pulseaudio-discuss] [PATCH] loopback: Fix crashes

Maarten Lankhorst m.b.lankhorst at gmail.com
Sun Jan 22 05:11:23 PST 2012


Flush the message queue before tearing down, and dest==NULL is valid in case moving failed.

With this my module-loopback finally no longer causes frequent crashes.

---
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 5291258..1f2ef91 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -136,6 +136,7 @@ static void teardown(struct userdata *u) {
      pa_assert(u);
      pa_assert_ctl_context();

+    pa_asyncmsgq_flush(u->asyncmsgq, 0);
      if (u->sink_input)
          pa_sink_input_unlink(u->sink_input);

@@ -360,6 +361,8 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
      pa_proplist *p;
      const char *n;
      struct userdata *u;
+    if (!dest)
+        return;

      pa_source_output_assert_ref(o);
      pa_assert_ctl_context();




More information about the pulseaudio-discuss mailing list