+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).
ffmpeg_options = {}
return (('ffmpeg-cdist', 'aab2fb1', ffmpeg_options),
- ('libdcp', 'd927e9b'),
+ ('libdcp', '937e435'),
('libsub', '3e299e5'))
def configure_options(target):
#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;