summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-04-05 14:29:47 +0100
committerCarl Hetherington <cth@carlh.net>2018-04-11 01:30:12 +0100
commitca813d739545b5b8fd7cbd7547f2cb197c222b82 (patch)
treec6377dd5c731055de42abe322b4f0db368b95b3b
parent88014e17b6e5ebee4f46f7e71c497b38e7764922 (diff)
Speculative fix for crash on startup with no audio devices (#1265).
-rw-r--r--ChangeLog4
-rw-r--r--src/wx/film_viewer.cc2
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d8234e23..3e001b4e6 100644
--- 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.
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 1103db159..9d79dd956 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -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()) {