Catch more exceptions from RtAudio (#2453).
authorCarl Hetherington <cth@carlh.net>
Tue, 14 Feb 2023 23:26:25 +0000 (00:26 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 21 Feb 2023 19:44:11 +0000 (20:44 +0100)
src/wx/film_viewer.cc

index fb02f0a0ff41074015ebc9c6b9b939aa5698f6b1..e7dcf564230e29ada4f907d8bdfa408d14a312e7 100644 (file)
@@ -622,10 +622,18 @@ FilmViewer::config_changed (Config::Property p)
                                ++st;
                        }
                        if (st == _audio.getDeviceCount()) {
-                               st = _audio.getDefaultOutputDevice();
+                               try {
+                                       st = _audio.getDefaultOutputDevice();
+                               } catch (RtAudioError&) {
+                                       /* Something went wrong with that device so we don't want to use it anyway */
+                               }
                        }
                } else {
-                       st = _audio.getDefaultOutputDevice();
+                       try {
+                               st = _audio.getDefaultOutputDevice();
+                       } catch (RtAudioError&) {
+                               /* Something went wrong with that device so we don't want to use it anyway */
+                       }
                }
 
                try {