Handle errors on startStream more nicely; might help with #1825.
authorCarl Hetherington <cth@carlh.net>
Thu, 15 Apr 2021 21:15:48 +0000 (23:15 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 15 Apr 2021 21:15:48 +0000 (23:15 +0200)
src/wx/film_viewer.cc

index 8805d1311c0ad9da1b0fd39dee168b4dad8e3369..4ea2a8b006b4a1fee6cac30e4c04fda735d00d52 100644 (file)
@@ -350,7 +350,15 @@ FilmViewer::start ()
          */
        if (_audio.isStreamOpen()) {
                _audio.setStreamTime (_video_view->position().seconds());
          */
        if (_audio.isStreamOpen()) {
                _audio.setStreamTime (_video_view->position().seconds());
-               _audio.startStream ();
+               try {
+                       _audio.startStream ();
+               } catch (RtAudioError& e) {
+                       _audio_channels = 0;
+                       error_dialog (
+                               _video_view->get(),
+                               _("There was a problem starting audio playback.  Please try another audio output device in Preferences."), std_to_wx(e.what())
+                               );
+               }
        }
 
        _playing = true;
        }
 
        _playing = true;