diff options
Diffstat (limited to 'src/wx/film_viewer.cc')
| -rw-r--r-- | src/wx/film_viewer.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index fbca835c2..e24583d6c 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -45,6 +45,7 @@ using std::min; using std::max; using std::cout; using std::list; +using std::bad_alloc; using std::make_pair; using boost::shared_ptr; using boost::dynamic_pointer_cast; @@ -126,7 +127,14 @@ FilmViewer::set_film (shared_ptr<Film> f) return; } - _player = f->make_player (); + try { + _player = f->make_player (); + } catch (bad_alloc) { + error_dialog (this, _("There is not enough free memory to do that.")); + _film.reset (); + return; + } + _player->disable_audio (); _player->Video.connect (boost::bind (&FilmViewer::process_video, this, _1, _2, _5)); _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1)); |
