|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:40
|
Module: performous
Branch: joinmenu
Commit: d6d3a4991e7d1735c8242aca92893afe626cf99a
Author: Felix Bertram <fl...@be...>
Date: Mon Jul 5 16:08:32 2010 -0700
bugfix for multiple audio devices in config
when multiple audio devices where specified in the config file, the code did not stop to use a device that was successfully opened. This patch fixes the behavior and stops at the first devices that can be opened.
---
game/main.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 91aed77..e577384 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,6 +145,9 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
+ // when we get here, we have successfully opened a device.
+ // let's use it then!
+ break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
|