summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-13 23:12:18 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-13 23:12:18 +0100
commit7acc2f5d8edc157c206012cb83167845ec7d09c7 (patch)
treea90d961537bdf08b062e805af2d1aa3852e98ea9
parent13aae5d8ff27886656ab7ea3ef1194987954bb3f (diff)
Improve error messages on failing to load DCP subs.
-rw-r--r--ChangeLog4
-rw-r--r--cscript2
-rw-r--r--src/lib/dcp_subtitle.cc15
3 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 44b857dfc..c57730218 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-06-13 Carl Hetherington <cth@carlh.net>
+
+ * Give better error messages when subtitles fail to load.
+
2016-06-13 c.hetherington <cth@carlh.net>
* Add button to move things to the start of reels (#798).
diff --git a/cscript b/cscript
index 260c0f2ec..82c39a0f8 100644
--- a/cscript
+++ b/cscript
@@ -237,7 +237,7 @@ def dependencies(target):
ffmpeg_options = {}
return (('ffmpeg-cdist', 'aab2fb1', ffmpeg_options),
- ('libdcp', 'd927e9b'),
+ ('libdcp', '937e435'),
('libsub', '3e299e5'))
def configure_options(target):
diff --git a/src/lib/dcp_subtitle.cc b/src/lib/dcp_subtitle.cc
index b0e114be2..f9aa7e0d9 100644
--- a/src/lib/dcp_subtitle.cc
+++ b/src/lib/dcp_subtitle.cc
@@ -20,34 +20,39 @@
#include "dcp_subtitle.h"
#include "exceptions.h"
+#include "compose.hpp"
#include <dcp/interop_subtitle_asset.h>
#include <dcp/smpte_subtitle_asset.h>
#include "i18n.h"
+using std::string;
+using std::exception;
using boost::shared_ptr;
shared_ptr<dcp::SubtitleAsset>
DCPSubtitle::load (boost::filesystem::path file) const
{
shared_ptr<dcp::SubtitleAsset> sc;
+ string interop_error;
+ string smpte_error;
try {
sc.reset (new dcp::InteropSubtitleAsset (file));
- } catch (...) {
-
+ } catch (exception& e) {
+ interop_error = e.what ();
}
if (!sc) {
try {
sc.reset (new dcp::SMPTESubtitleAsset (file));
- } catch (...) {
-
+ } catch (exception& e) {
+ smpte_error = e.what();
}
}
if (!sc) {
- throw FileError (_("Could not read subtitles"), file);
+ throw FileError (String::compose (_("Could not read subtitles (%1 / %2)"), interop_error, smpte_error), file);
}
return sc;