improve video-server start-up sequence
authorRobin Gareus <robin@gareus.org>
Sun, 9 Jun 2013 13:51:31 +0000 (15:51 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 9 Jun 2013 13:51:31 +0000 (15:51 +0200)
* don't wait if launching the app failed
* lower timeout and check interval
* print warnings..

gtk2_ardour/ardour_ui.cc

index 6456cdd74f7d92defd6894ab283ff630c13f4f8d..882e764d6a847e46fcf7731dabace69770e74504 100644 (file)
@@ -3428,11 +3428,17 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
                }
 
                video_server_process = new SystemExec(icsd_exec, argp);
-               video_server_process->start();
-               int timeout = 10;
+               if (video_server_process->start()) {
+                       warning << _("Cannot launch the video-server") << endmsg;
+                       continue;
+               }
+               int timeout = 120; // 6 sec
                while (!ARDOUR_UI::instance()->video_timeline->check_server()) {
-                       sleep(1);
-                       if (--timeout <= 0) break;
+                       usleep (50000);
+                       if (--timeout <= 0 || !video_server_process->is_running()) break;
+               }
+               if (timeout <= 0) {
+                       warning << _("Video-server was started but does not respond to requests...") << endmsg;
                }
        }
        return true;