[X2Go-Commits] [x2goclient] 166/217: src/pulsemanager.cpp: don't time out while trying to start PA or paplay.

git-admin at x2go.org git-admin at x2go.org
Sat Aug 27 19:26:16 CEST 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit b03cf757c74066ebab4802fa376ae3fbd05785d4
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat May 7 22:28:38 2016 +0200

    src/pulsemanager.cpp: don't time out while trying to start PA or paplay.
    
    "Handle" errors by printing out debug messages.
---
 debian/changelog     |    2 ++
 src/pulsemanager.cpp |   16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 40a3caf..d944d41 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -308,6 +308,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium
       declaration for set_debug ().
     - res/sound: add startup.wav sound to be played back when starting the PA
       daemon in debug mode.
+    - src/pulsemanager.cpp: don't time out while trying to start PA or paplay.
+      "Handle" errors by printing out debug messages.
   * debian/control:
     - Maintainer change in package: X2Go Developers <x2go-dev at lists.x2go.org>.
     - Uploaders: add myself. Also, force a rebuild due to the changed
diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp
index ed841eb..ee6c63c 100644
--- a/src/pulsemanager.cpp
+++ b/src/pulsemanager.cpp
@@ -132,7 +132,12 @@ void PulseManager::start_generic () {
   pulse_server_->setWorkingDirectory (server_working_dir_);
 
   pulse_server_->start (server_binary_, server_args_);
-  if (pulse_server_->waitForStarted ()) {
+
+  /*
+   * We may wait here, because PulseManager runs in a separate thread.
+   * Otherwise, we'd better use signals and slots to not block the main thread.
+   */
+  if (pulse_server_->waitForStarted (-1)) {
     x2goDebug << "pulse started with arguments" << server_args_ << "; waiting for finish...";
     state_ = QProcess::Running;
 
@@ -144,6 +149,9 @@ void PulseManager::start_generic () {
       QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ()));
     }
   }
+  else {
+    x2goErrorf (27) << "PulseAudio failed to start! Sound support will not be available.";
+  }
 }
 
 void PulseManager::start_osx () {
@@ -562,8 +570,12 @@ void PulseManager::slot_play_startup_sound () {
     play_file.setProcessEnvironment (env_);
     play_file.start (play_file_binary, args);
 
-    if (play_file.waitForStarted ())
+    if (play_file.waitForStarted (-1)) {
       play_file.waitForFinished ();
+    }
+    else {
+      x2goErrorf (26) << "Unable to play startup sound! Something may be wrong.";
+    }
   }
 }
 

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list