From: Carl Hetherington Date: Tue, 20 Sep 2016 20:09:02 +0000 (+0100) Subject: Give better errors on Subrip parse failures. X-Git-Tag: v2.9.24~4 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=24ae62cee407a05ce391884ce3bce03f53de7982 Give better errors on Subrip parse failures. --- diff --git a/ChangeLog b/ChangeLog index cde3b2b2e..4f22c362e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2016-09-20 Carl Hetherington + * Give better errors on SubRip parse failures. + * Version 2.9.23 released. 2016-09-20 Carl Hetherington diff --git a/cscript b/cscript index ee481d4a0..3724ab4b1 100644 --- a/cscript +++ b/cscript @@ -234,7 +234,7 @@ def dependencies(target): return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options), ('libdcp', 'b105b7d'), - ('libsub', '067c21c')) + ('libsub', '79e49c2')) def configure_options(target): opt = '' diff --git a/src/lib/job.cc b/src/lib/job.cc index 6e2bc9f53..ed0370479 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -30,8 +30,10 @@ #include "log.h" #include "compose.hpp" #include +#include #include #include +#include #include #include "i18n.h" @@ -149,6 +151,17 @@ Job::run_wrapper () set_state (FINISHED_CANCELLED); + } catch (sub::SubripError& e) { + + string extra = "Error is near:\n"; + BOOST_FOREACH (string i, e.context()) { + extra += i + "\n"; + } + + set_error (e.what (), extra); + set_progress (1); + set_state (FINISHED_ERROR); + } catch (std::bad_alloc& e) { set_error (_("Out of memory"), _("There was not enough memory to do this. If you are running a 32-bit operating system try reducing the number of encoding threads in the General tab of Preferences."));