[ekiga] Made the video preview delayed at startup -- a five second wait



commit 6f96a6d2b8f21705aa39d4701fc9664e25d684d5
Author: Snark <jpuydt gnome org>
Date:   Wed Oct 20 14:32:41 2010 +0200

    Made the video preview delayed at startup -- a five second wait
    
    That will make our startup a little faster... not by much, but still.

 lib/engine/videoinput/videoinput-gmconf-bridge.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/lib/engine/videoinput/videoinput-gmconf-bridge.cpp b/lib/engine/videoinput/videoinput-gmconf-bridge.cpp
index 2feb387..8195f5e 100644
--- a/lib/engine/videoinput/videoinput-gmconf-bridge.cpp
+++ b/lib/engine/videoinput/videoinput-gmconf-bridge.cpp
@@ -130,11 +130,21 @@ void VideoInputCoreConfBridge::on_property_changed (std::string key, GmConfEntry
   }
   else if (key == VIDEO_DEVICES_KEY "enable_preview") {
 
-    PTRACE(4, "VidInputCoreConfBridge\tUpdating preview");
-    if (gm_conf_get_bool ( VIDEO_DEVICES_KEY "enable_preview"))
-        videoinput_core.start_preview(); 
+    static bool startup = true;
+
+    if (!startup) {
+
+      PTRACE(4, "VidInputCoreConfBridge\tUpdating preview");
+      if (gm_conf_get_bool ( VIDEO_DEVICES_KEY "enable_preview"))
+        videoinput_core.start_preview();
       else
         videoinput_core.stop_preview();
+    } else {
+
+      startup = false;
+      if (gm_conf_get_bool ( VIDEO_DEVICES_KEY "enable_preview"))
+	Ekiga::Runtime::run_in_main (boost::bind (&VideoInputCore::start_preview, boost::ref (videoinput_core)), 5);
+    }
   }
   else if (key == VIDEO_DEVICES_KEY "image") {
     PTRACE(4, "VidInputCoreConfBridge\tUpdating image");



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