[pulseaudio-commits] r1875 - /branches/lennart/src/modules/module-combine.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Sep 20 15:02:00 PDT 2007


Author: lennart
Date: Fri Sep 21 00:01:58 2007
New Revision: 1875

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1875&root=pulseaudio&view=rev
Log:
don't segfault when the master changes

Modified:
    branches/lennart/src/modules/module-combine.c

Modified: branches/lennart/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/module-combine.c?rev=1875&root=pulseaudio&r1=1874&r2=1875&view=diff
==============================================================================
--- branches/lennart/src/modules/module-combine.c (original)
+++ branches/lennart/src/modules/module-combine.c Fri Sep 21 00:01:58 2007
@@ -394,8 +394,6 @@
                 u->master->sink->rtpoll,
                 PA_RTPOLL_EARLY+1,  /* This one has a slightly lower priority than the normal message handling */
                 k->outq);
-
-        pa_log("1: %p now has rptoll item %p", k, k->outq_rtpoll_item);
     }
 }
 
@@ -425,8 +423,6 @@
 
     pa_sink_input_assert_ref(i);
     pa_assert_se(o = i->userdata);
-
-    pa_log("attaching %s", i->sink->name);
 
     if (o->userdata->thread_info.master == o) {
         create_master_rtpolls(o->userdata);
@@ -636,6 +632,14 @@
         }
 
         case SINK_MESSAGE_SET_MASTER:
+
+            if (u->thread_info.master && data != u->thread_info.master) {
+
+                if (u->thread_info.master->sink_input->thread_info.attached)
+                    free_master_rtpolls(u);
+
+            }
+
             if ((u->thread_info.master = data)) {
 
                 /* There's now a master, and we're being executed in
@@ -645,12 +649,8 @@
                 if (u->thread_info.master->sink_input->thread_info.attached)
                     create_master_rtpolls(u);
 
-            } else {
-
-                if (u->thread_info.master->sink_input->thread_info.attached)
-                    free_master_rtpolls(u);
-
             }
+
             return 0;
 
         case SINK_MESSAGE_ADD_OUTPUT: {
@@ -667,19 +667,13 @@
                         u->thread_info.master->sink->rtpoll,
                         PA_RTPOLL_EARLY+1,  /* This one has a slightly lower priority than the normal message handling */
                         op->outq);
-
-                pa_log("2: %p now has rptoll item %p", op, op->outq_rtpoll_item);
             }
-
-            pa_log("Added output %s", op->sink_input->sink->name);
 
             return 0;
         }
 
         case SINK_MESSAGE_REMOVE_OUTPUT: {
             struct output *op = data;
-
-            pa_log("Remove output %s", op->sink_input->sink->name);
 
             PA_LLIST_REMOVE(struct output, u->thread_info.outputs, op);
 




More information about the pulseaudio-commits mailing list