summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-12-13 13:10:20 +0000
committerCarl Hetherington <cth@carlh.net>2017-12-13 13:10:20 +0000
commitfb771f2613cd3e7f43bf613d592d6937a1017f2d (patch)
tree1504ef2208b699608a397e4c7419c1ef8f01ae9e /src
parent0821680fab2fec732b3be8df931671929a4ad7bf (diff)
Speculative fixes for hangs when audio stream cannot be opened.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 60025a7de..0bb582c66 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -253,7 +253,7 @@ FilmViewer::recreate_butler ()
}
_butler.reset (new Butler (_player, _film->log(), map, _audio_channels));
- if (!Config::instance()->sound()) {
+ if (!Config::instance()->sound() && !_audio.isStreamOpen()) {
_butler->disable_audio ();
}
@@ -743,8 +743,6 @@ FilmViewer::config_changed (Config::Property p)
_audio_channels = _audio.getDeviceInfo(st).outputChannels;
- recreate_butler ();
-
RtAudio::StreamParameters sp;
sp.deviceId = st;
sp.nChannels = _audio_channels;
@@ -761,6 +759,7 @@ FilmViewer::config_changed (Config::Property p)
wxString::Format (_("Could not set up audio output (%s). There will be no audio during the preview."), e.what())
);
}
+ recreate_butler ();
} else {
_audio_channels = 0;