summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-15 11:13:15 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-15 11:13:15 +0000
commit81539f14847954c48b59a005c5de0435ac62b3c3 (patch)
tree33127bff364edc7092e7ec857089fb9531ee443f /src
parentcc82c178a8fb129c55dd40a927b29f693884f7a3 (diff)
Catch exceptions when getting video for the view.
Diffstat (limited to 'src')
-rw-r--r--src/wx/dcp_panel.cc4
-rw-r--r--src/wx/film_viewer.cc9
2 files changed, 10 insertions, 3 deletions
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<Film> 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<shared_ptr<PlayerVideo> > pvf = _player->get_video (p, accurate);
+ list<shared_ptr<PlayerVideo> > 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);