[ekiga] Fixed possible threading issues in the null audio output code



commit 65f088d2a24d2b20fdfa5d3c05ec5b9973f8cf11
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Tue Apr 21 18:14:56 2009 +0200

    Fixed possible threading issues in the null audio output code
    
    don't use make_slot in threads
---
 .../null-audiooutput/audiooutput-manager-null.cpp  |   19 +++++++++++++++++--
 .../null-audiooutput/audiooutput-manager-null.h    |    8 ++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/lib/engine/components/null-audiooutput/audiooutput-manager-null.cpp b/lib/engine/components/null-audiooutput/audiooutput-manager-null.cpp
index 85cf1c0..5334fb9 100644
--- a/lib/engine/components/null-audiooutput/audiooutput-manager-null.cpp
+++ b/lib/engine/components/null-audiooutput/audiooutput-manager-null.cpp
@@ -87,7 +87,7 @@ bool GMAudioOutputManager_null::open (Ekiga::AudioOutputPS ps, unsigned channels
   Ekiga::AudioOutputSettings settings;
   settings.volume = 0;
   settings.modifyable = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_opened.make_slot (), ps, current_state[ps].device, settings));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMAudioOutputManager_null::device_opened_in_main), ps, current_state[ps].device, settings));
 
   return true;
 }
@@ -95,7 +95,7 @@ bool GMAudioOutputManager_null::open (Ekiga::AudioOutputPS ps, unsigned channels
 void GMAudioOutputManager_null::close(Ekiga::AudioOutputPS ps)
 {
   current_state[ps].opened = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_closed.make_slot (), ps, current_state[ps].device));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMAudioOutputManager_null::device_closed_in_main), ps, current_state[ps].device));
 }
 
 
@@ -119,3 +119,18 @@ bool GMAudioOutputManager_null::has_device(const std::string & /*sink*/, const s
 {
   return false;
 }
+
+void
+GMAudioOutputManager_null::device_opened_in_main (Ekiga::AudioOutputPS ps,
+						  Ekiga::AudioOutputDevice device,
+						  Ekiga::AudioOutputSettings settings)
+{
+  device_opened.emit (ps, device, settings);
+}
+
+void
+GMAudioOutputManager_null::device_closed_in_main (Ekiga::AudioOutputPS ps,
+						  Ekiga::AudioOutputDevice device)
+{
+  device_closed.emit (ps, device);
+}
diff --git a/lib/engine/components/null-audiooutput/audiooutput-manager-null.h b/lib/engine/components/null-audiooutput/audiooutput-manager-null.h
index 333cee5..0ee29ad 100644
--- a/lib/engine/components/null-audiooutput/audiooutput-manager-null.h
+++ b/lib/engine/components/null-audiooutput/audiooutput-manager-null.h
@@ -76,6 +76,14 @@
       Ekiga::ServiceCore & core;
 
       PAdaptiveDelay adaptive_delay[2];
+
+    private:
+      void device_opened_in_main (Ekiga::AudioOutputPS ps,
+				  Ekiga::AudioOutputDevice device,
+				  Ekiga::AudioOutputSettings settings);
+      void device_closed_in_main (Ekiga::AudioOutputPS ps,
+				  Ekiga::AudioOutputDevice device);
+
   };
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]