summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-02-25 22:00:51 +0000
committerCarl Hetherington <cth@carlh.net>2013-02-25 22:00:51 +0000
commit00220cc5223f5b1823dd4aa91993f5257d8938fd (patch)
tree7cebfb09a132195cad05a0cfe591de0d1be18be8 /src
parente13fde5e5525c5feb69cae6618f484158378d116 (diff)
Catch exception on loading film with bad content file.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 96656ce09..6d46b2c21 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -101,7 +101,14 @@ FilmViewer::film_changed (Film::Property p)
o.decode_audio = false;
o.decode_subtitles = true;
o.video_sync = false;
- _decoders = decoder_factory (_film, o);
+
+ try {
+ _decoders = decoder_factory (_film, o);
+ } catch (StringError& e) {
+ error_dialog (this, wxString::Format (_("Could not open content file (%s)"), e.what()));
+ return;
+ }
+
if (_decoders.video == 0) {
break;
}