From 3330f33acc407c0f657549472c3efc04cb2fe533 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 19 Aug 2017 23:27:43 +0100 Subject: [PATCH] Fix crash when setting player decode resolution with no loaded DCP (#1115). --- src/wx/film_viewer.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 505245927..9493a55c9 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -197,6 +197,9 @@ FilmViewer::set_film (shared_ptr film) try { _player.reset (new Player (_film, _film->playlist ())); _player->set_fast (); + if (_dcp_decode_reduction) { + _player->set_dcp_decode_reduction (_dcp_decode_reduction); + } } catch (bad_alloc) { error_dialog (this, _("There is not enough free memory to do that.")); _film.reset (); @@ -811,7 +814,10 @@ FilmViewer::average_latency () const void FilmViewer::set_dcp_decode_reduction (optional reduction) { - _player->set_dcp_decode_reduction (reduction); + _dcp_decode_reduction = reduction; + if (_player) { + _player->set_dcp_decode_reduction (reduction); + } } DCPTime -- 2.30.2