[ekiga/gnome-2-26] Fixed possible threading issues in the null audio input code



commit 6cc0e760d029335ad634e8d1c9996e0b7f8b7a31
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Tue Apr 21 18:09:38 2009 +0200

    Fixed possible threading issues in the null audio input code
    
    don't use make_slot in threads
---
 .../null-audioinput/audioinput-manager-null.cpp    |   17 +++++++++++++++--
 .../null-audioinput/audioinput-manager-null.h      |    5 +++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/lib/engine/components/null-audioinput/audioinput-manager-null.cpp b/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
index 6da39f2..c7e439d 100644
--- a/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
+++ b/lib/engine/components/null-audioinput/audioinput-manager-null.cpp
@@ -86,7 +86,7 @@ bool GMAudioInputManager_null::open (unsigned channels, unsigned samplerate, uns
   Ekiga::AudioInputSettings settings;
   settings.volume = 0;
   settings.modifyable = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMAudioInputManager_null::device_opened_in_main), current_state.device, settings));
 
   return true;
 }
@@ -94,7 +94,7 @@ bool GMAudioInputManager_null::open (unsigned channels, unsigned samplerate, uns
 void GMAudioInputManager_null::close()
 {
   current_state.opened = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMAudioInputManager_null::device_closed_in_main), current_state.device));
 }
 
 
@@ -119,3 +119,16 @@ bool GMAudioInputManager_null::has_device(const std::string & /*source*/, const
 {
   return false;
 }
+
+void
+GMAudioInputManager_null::device_opened_in_main (Ekiga::AudioInputDevice device,
+						 Ekiga::AudioInputSettings settings)
+{
+  device_opened.emit (device, settings);
+}
+
+void
+GMAudioInputManager_null::device_closed_in_main (Ekiga::AudioInputDevice device)
+{
+  device_closed.emit (device);
+}
diff --git a/lib/engine/components/null-audioinput/audioinput-manager-null.h b/lib/engine/components/null-audioinput/audioinput-manager-null.h
index 5761455..7462f08 100644
--- a/lib/engine/components/null-audioinput/audioinput-manager-null.h
+++ b/lib/engine/components/null-audioinput/audioinput-manager-null.h
@@ -77,6 +77,11 @@
       Ekiga::ServiceCore & core;
 
       PAdaptiveDelay adaptive_delay;
+
+    private:
+      void device_opened_in_main (Ekiga::AudioInputDevice device,
+				  Ekiga::AudioInputSettings settings);
+      void device_closed_in_main (Ekiga::AudioInputDevice device);
   };
 /**
  * @}



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