From 439e84dc3659d2139452bfadf4bf4374a58fb66f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Dec 2012 20:07:17 +0000 Subject: Catch exceptions thrown when decoding video for the viewer. --- src/wx/film_viewer.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 98f303593..6c099919f 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -32,6 +32,7 @@ #include "lib/subtitle.h" #include "lib/image.h" #include "lib/scaler.h" +#include "lib/exceptions.h" #include "film_viewer.h" #include "wx_util.h" #include "video_decoder.h" @@ -307,14 +308,14 @@ FilmViewer::process_video (shared_ptr image, shared_ptr sub) void FilmViewer::get_frame () { - if (!_out_width || !_out_height) { - return; - } - - shared_ptr last = _display_frame; - while (last == _display_frame) { - if (_decoders.video->pass ()) { - break; + try { + shared_ptr last = _display_frame; + while (last == _display_frame) { + if (_decoders.video->pass ()) { + break; + } } + } catch (DecodeError& e) { + error_dialog (this, String::compose ("Could not decode video for view (%1)", e.what())); } } -- cgit v1.2.3