Speculative fix for crash on startup with no audio devices (#1265). v2.13.11
authorCarl Hetherington <cth@carlh.net>
Thu, 5 Apr 2018 13:29:47 +0000 (14:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 5 Apr 2018 13:29:47 +0000 (14:29 +0100)
ChangeLog
src/wx/film_viewer.cc

index 40808c6b3bc6b1ae04d2e1876eb6abdd9453a2f2..2fa259e611453349ff21fc3833808d84fb911068 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2018-04-05  Carl Hetherington  <cth@carlh.net>
 
+       * Fix crash on startup if there are no audio devices (#1265).
+
        * Fix non-working arrow keys / space in text fields (#1263).
 
        * Fix assertion failures with 3D content in some cases.
index 5cd09048cb987d2d856f0f26acd03751a8e1a1e2..ccb2b790de4fe816e03c7846967ebff5b581b1b4 100644 (file)
@@ -818,7 +818,7 @@ FilmViewer::config_changed (Config::Property p)
                _audio.closeStream ();
        }
 
-       if (Config::instance()->sound()) {
+       if (Config::instance()->sound() && _audio.getDeviceCount() > 0) {
                unsigned int st = 0;
                if (Config::instance()->sound_output()) {
                        while (st < _audio.getDeviceCount()) {