diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-20 22:18:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-01-08 21:56:47 +0100 |
| commit | 83c9e9c858072ab919916269790dcc65565fdd25 (patch) | |
| tree | ec0dc30ff0bd6b15fbd281893576536b82c22190 /src/wx/gl_video_view.cc | |
| parent | 4f7e9f125716a27ed9e2a8e30f067100cbee773a (diff) | |
Don't try opening error dialogues from the GL thread.
Diffstat (limited to 'src/wx/gl_video_view.cc')
| -rw-r--r-- | src/wx/gl_video_view.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index a1be8ca30..836b3eb35 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -20,11 +20,13 @@ #include "gl_video_view.h" #include "film_viewer.h" +#include "wx_util.h" #include "lib/image.h" #include "lib/dcpomatic_assert.h" #include "lib/exceptions.h" #include "lib/cross.h" #include "lib/player_video.h" +#include "lib/butler.h" #include <boost/bind.hpp> #include <iostream> @@ -63,6 +65,10 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent) _canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized))); _canvas->Bind (wxEVT_CREATE, boost::bind(&GLVideoView::create, this)); + _canvas->Bind (wxEVT_TIMER, boost::bind(&GLVideoView::check_for_butler_errors, this)); + _timer.reset (new wxTimer(_canvas)); + _timer->Start (2000); + #if defined(DCPOMATIC_LINUX) && defined(DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT) if (_canvas->IsExtensionSupported("GLX_EXT_swap_control")) { /* Enable vsync */ @@ -105,6 +111,16 @@ GLVideoView::~GLVideoView () glDeleteTextures (1, &_id); } +void +GLVideoView::check_for_butler_errors () +{ + try { + _viewer->butler()->rethrow (); + } catch (DecodeError& e) { + error_dialog (get(), e.what()); + } +} + static void check_gl_error (char const * last) { |
