summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-25 21:04:06 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-25 21:04:06 +0200
commitd7cf091bdbbeae8187e887104d1135e93bcdf5da (patch)
treef94ebe4a5342a10a6aab012d3a7c14bc4dfd8261
parente98f84b69cc9e4e67667326194f14abe422978d2 (diff)
Add missing try/catch to a call to getDeviceInfo.
-rw-r--r--src/wx/config_dialog.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 8eddeab4d..fe8e84795 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -995,9 +995,17 @@ SoundPage::config_changed ()
int channels = 0;
if (configured_so) {
for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
- RtAudio::DeviceInfo info = audio.getDeviceInfo(i);
- if (info.name == *configured_so && info.outputChannels > 0) {
- channels = info.outputChannels;
+ try {
+ RtAudio::DeviceInfo info = audio.getDeviceInfo(i);
+ if (info.name == *configured_so && info.outputChannels > 0) {
+ channels = info.outputChannels;
+ }
+#ifdef DCPOMATIC_USE_RTERROR
+ } catch (RtError&) {
+#else
+ } catch (RtAudioError&) {
+#endif
+ /* Never mind */
}
}
}