|
From: Johnny O. <js...@us...> - 2010-10-28 20:46:09
|
Module: performous
Branch: opengl2
Commit: 5be9ea201fd5cac029bec1ed50fd47e57ef24963
Author: Tapio Vierros <tap...@gm...>
Date: Sat Oct 23 19:09:40 2010 +0300
Tweak audiokiller delays to get message in screen_audiodevices.
---
game/libda/portaudio.hpp | 8 ++++----
game/screen_audiodevices.cc | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/libda/portaudio.hpp b/game/libda/portaudio.hpp
index b4d512d..fb8f9d2 100644
--- a/game/libda/portaudio.hpp
+++ b/game/libda/portaudio.hpp
@@ -73,8 +73,8 @@ namespace portaudio {
~Init() {
// Give audio a little time to shutdown but then just quit
boost::thread audiokiller(Pa_Terminate);
- if (!audiokiller.timed_join(boost::posix_time::milliseconds(2000))) {
- std::cout << "PortAudio BUG: Pa_Terminate hung for more than two seconds. Exiting program." << std::endl;
+ if (!audiokiller.timed_join(boost::posix_time::milliseconds(5000))) {
+ std::cout << "PortAudio BUG: Pa_Terminate hung for more than five seconds. Exiting program." << std::endl;
exit(1);
}
}
@@ -125,8 +125,8 @@ namespace portaudio {
~Stream() {
// Give audio a little time to shutdown but then just quit
boost::thread audiokiller(Pa_CloseStream, m_handle);
- if (!audiokiller.timed_join(boost::posix_time::milliseconds(2000))) {
- std::cout << "PortAudio BUG: Pa_CloseStream hung for more than two seconds. Exiting program." << std::endl;
+ if (!audiokiller.timed_join(boost::posix_time::milliseconds(5000))) {
+ std::cout << "PortAudio BUG: Pa_CloseStream hung for more than five seconds. Exiting program." << std::endl;
exit(1);
}
}
diff --git a/game/screen_audiodevices.cc b/game/screen_audiodevices.cc
index 7208117..4bf0afd 100644
--- a/game/screen_audiodevices.cc
+++ b/game/screen_audiodevices.cc
@@ -177,7 +177,7 @@ bool ScreenAudioDevices::save(bool skip_ui_config) {
size_t unassigned_id = m_devs.size();
// Give audio a little time to shutdown but then just quit
boost::thread audiokiller(boost::bind(&Audio::close, boost::ref(m_audio)));
- if (!audiokiller.timed_join(boost::posix_time::milliseconds(4000)))
+ if (!audiokiller.timed_join(boost::posix_time::milliseconds(2500)))
ScreenManager::getSingletonPtr()->fatalError("Audio hung for some reason.\nPlease restart Performous.");
m_audio.restart(); // Reload audio to take the new settings into use
m_audio.playMusic(getThemePath("menu.ogg"), true); // Start music again
|