From fb771f2613cd3e7f43bf613d592d6937a1017f2d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 13 Dec 2017 13:10:20 +0000 Subject: [PATCH] Speculative fixes for hangs when audio stream cannot be opened. --- src/wx/film_viewer.cc | 5 ++--- 1 file 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; -- 2.30.2