From 81539f14847954c48b59a005c5de0435ac62b3c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 Dec 2014 11:13:15 +0000 Subject: Catch exceptions when getting video for the view. --- src/wx/dcp_panel.cc | 4 ++-- src/wx/film_viewer.cc | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index b56a783bb..774f41667 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -68,9 +68,9 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr f) { wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _edit_isdcf_button = new wxButton (_dcp_panel, wxID_ANY, _("Details...")); + _edit_isdcf_button = new wxButton (_panel, wxID_ANY, _("Details...")); s->Add (_edit_isdcf_button, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP); - _copy_isdcf_name_button = new wxButton (_dcp_panel, wxID_ANY, _("Copy as name")); + _copy_isdcf_name_button = new wxButton (_panel, wxID_ANY, _("Copy as name")); s->Add (_copy_isdcf_name_button, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_X_GAP); grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND); ++r; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index a46983a6f..de12564d7 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -50,6 +50,7 @@ using std::cout; using std::list; using std::bad_alloc; using std::make_pair; +using std::exception; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::weak_ptr; @@ -169,7 +170,13 @@ FilmViewer::get (DCPTime p, bool accurate) return; } - list > pvf = _player->get_video (p, accurate); + list > pvf; + try { + pvf = _player->get_video (p, accurate); + } catch (exception& e) { + error_dialog (this, wxString::Format (_("Could not get video for view (%s)"), std_to_wx(e.what()).data())); + } + if (!pvf.empty ()) { try { _frame = pvf.front()->image (PIX_FMT_RGB24, true); -- cgit v1.2.3