[pulseaudio-commits] r1243 - in /trunk/src/pulsecore: core.c core.h sink.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Aug 13 10:33:32 PDT 2006


Author: lennart
Date: Sun Aug 13 19:33:32 2006
New Revision: 1243

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1243&root=pulseaudio&view=rev
Log:
properly implement a pa_sink_disconnect() hook

Modified:
    trunk/src/pulsecore/core.c
    trunk/src/pulsecore/core.h
    trunk/src/pulsecore/sink.c

Modified: trunk/src/pulsecore/core.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/core.c?rev=1243&root=pulseaudio&r1=1242&r2=1243&view=diff
==============================================================================
--- trunk/src/pulsecore/core.c (original)
+++ trunk/src/pulsecore/core.c Sun Aug 13 19:33:32 2006
@@ -93,7 +93,7 @@
     c->is_system_instance = 0;
 
     pa_hook_init(&c->hook_sink_input_new, c);
-    pa_hook_init(&c->hook_sink_input_disconnect, c);
+    pa_hook_init(&c->hook_sink_disconnect, c);
 
     pa_property_init(c);
 
@@ -142,7 +142,7 @@
     pa_property_cleanup(c);
 
     pa_hook_free(&c->hook_sink_input_new);
-    pa_hook_free(&c->hook_sink_input_disconnect);
+    pa_hook_free(&c->hook_sink_disconnect);
     
     pa_xfree(c);    
 }

Modified: trunk/src/pulsecore/core.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/core.h?rev=1243&root=pulseaudio&r1=1242&r2=1243&view=diff
==============================================================================
--- trunk/src/pulsecore/core.h (original)
+++ trunk/src/pulsecore/core.h Sun Aug 13 19:33:32 2006
@@ -81,7 +81,8 @@
     int is_system_instance;
 
     /* hooks */
-    pa_hook hook_sink_input_new, hook_sink_input_disconnect;
+    pa_hook hook_sink_input_new,
+        hook_sink_disconnect;
 };
 
 pa_core* pa_core_new(pa_mainloop_api *m);

Modified: trunk/src/pulsecore/sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/sink.c?rev=1243&root=pulseaudio&r1=1242&r2=1243&view=diff
==============================================================================
--- trunk/src/pulsecore/sink.c (original)
+++ trunk/src/pulsecore/sink.c Sun Aug 13 19:33:32 2006
@@ -143,7 +143,10 @@
     assert(s);
     assert(s->state == PA_SINK_RUNNING);
 
+    s->state = PA_SINK_DISCONNECTED;
     pa_namereg_unregister(s->core, s->name);
+
+    pa_hook_fire(&s->core->hook_sink_disconnect, s);
     
     while ((i = pa_idxset_first(s->inputs, NULL))) {
         assert(i != j);
@@ -163,7 +166,6 @@
     s->set_hw_mute = NULL;
     s->get_hw_mute = NULL;
     
-    s->state = PA_SINK_DISCONNECTED;
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_REMOVE, s->index);
 }
 




More information about the pulseaudio-commits mailing list