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

index 2d8234e23448ad977022ca7b88fa052d072da4d5..3e001b4e6d92dbace9d263821f52d08ad82ab201 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-2018-04-06  Carl Hetherington  <cth@carlh.net>
+2018-04-05  Carl Hetherington  <cth@carlh.net>
+
+       * Fix crash on startup if there are no audio devices (#1265).
 
        * Fix missing start icon for the player in Linux.
 
index 1103db159f5a5c2bdd1a98d8339c86cd4d056509..9d79dd956b9bc9f29b7d44e615048fae4f780d87 100644 (file)
@@ -796,7 +796,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()) {