Catch exceptions when getting video for the view.
authorCarl Hetherington <cth@carlh.net>
Mon, 15 Dec 2014 11:13:15 +0000 (11:13 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 15 Dec 2014 11:13:15 +0000 (11:13 +0000)
TO_PORT
src/wx/dcp_panel.cc
src/wx/film_viewer.cc

diff --git a/TO_PORT b/TO_PORT
index 2e7d3a6b416a41d50c318fc63aa987ee29a21cca..d72d9e776f6641fb4e858cc9671aef41d2d17fb3 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,2 +1 @@
-e0b8987596d7b5bb032900305e8ef522e795e8d8
 4806d9f4864e2cb7f41b2cc430bbaa869248cf35
index b56a783bbb06e2c41cf619cb959e5929f45e5e0c..774f416676a3dd975d363d56575652b547a82bbd 100644 (file)
@@ -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;
index a46983a6f9972b0bf41efbc28ef1a4d03372988e..de12564d7756b61730b5ad5f9a54d90f529fbbeb 100644 (file)
@@ -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);