X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.cc;h=0bb582c66dffe8d6b46ca649eee103f20c53dc5d;hp=60025a7de290dbebcdbdabc5bf1facea81d08767;hb=fb771f2613cd3e7f43bf613d592d6937a1017f2d;hpb=0821680fab2fec732b3be8df931671929a4ad7bf 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;