Add missing try/catch to a call to getDeviceInfo.
authorCarl Hetherington <cth@carlh.net>
Fri, 25 Sep 2020 19:04:06 +0000 (21:04 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Sep 2020 19:04:06 +0000 (21:04 +0200)
src/wx/config_dialog.cc

index 8eddeab4dff6904f3caca18602c0a116b6fb9efe..fe8e847951fc1d74aaa3baf758d2d45f24a68d99 100644 (file)
@@ -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 */
                        }
                }
        }