diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-17 20:07:17 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-17 20:07:17 +0000 |
| commit | 439e84dc3659d2139452bfadf4bf4374a58fb66f (patch) | |
| tree | b82f71e699ff8fb6d735d5418848d5accc3c3817 /src | |
| parent | e729c3bd175e4fa47287fec9955eb06cff4840d9 (diff) | |
Catch exceptions thrown when decoding video for the viewer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_viewer.cc | 17 |
1 files changed, 9 insertions, 8 deletions
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> image, shared_ptr<Subtitle> sub) void FilmViewer::get_frame () { - if (!_out_width || !_out_height) { - return; - } - - shared_ptr<Image> last = _display_frame; - while (last == _display_frame) { - if (_decoders.video->pass ()) { - break; + try { + shared_ptr<Image> 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())); } } |
