|
From: Lasse Kärkkäi. <tr...@us...> - 2010-10-23 16:13:36
|
Module: performous
Branch: master
Commit: e5f84f909950df964ac1a492b018960effe17f91
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Oct 23 18:11:51 2010 +0200
Further audio init/hang tuning.
---
game/libda/portaudio.hpp | 9 +--------
game/main.cc | 9 ++++-----
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/game/libda/portaudio.hpp b/game/libda/portaudio.hpp
index fb8f9d2..6172e69 100644
--- a/game/libda/portaudio.hpp
+++ b/game/libda/portaudio.hpp
@@ -70,14 +70,7 @@ namespace portaudio {
struct Init {
Init() { PORTAUDIO_CHECKED(Pa_Initialize, ()); }
- ~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(5000))) {
- std::cout << "PortAudio BUG: Pa_Terminate hung for more than five seconds. Exiting program." << std::endl;
- exit(1);
- }
- }
+ ~Init() { Pa_Terminate(); }
};
struct Params {
diff --git a/game/main.cc b/game/main.cc
index 8596583..1ce92ff 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -115,18 +115,17 @@ static void checkEvents_SDL(ScreenManager& sm) {
}
void mainLoop(std::string const& songlist) {
- Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b());
Audio audio;
{ // Print the devices
portaudio::AudioDevices ads;
std::clog << "audio/info:\n" << ads.dump();
}
+ Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), config["graphic/fullscreen"].b());
+ Backgrounds backgrounds;
+ Database database(getConfigDir() / "database.xml");
+ Songs songs(database, songlist);
ScreenManager sm(window);
try {
- sm.loading(_("Launching background loaders..."), 0.4);
- Backgrounds backgrounds;
- Database database(getConfigDir() / "database.xml");
- Songs songs(database, songlist);
boost::scoped_ptr<input::MidiDrums> midiDrums;
// TODO: Proper error handling...
try { midiDrums.reset(new input::MidiDrums); } catch (std::runtime_error&) {}
|