summaryrefslogtreecommitdiff
path: root/src/lib/dcp_subtitle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-01 01:31:35 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-01 01:31:35 +0200
commit8963f0007af1a312017b9627c18b82ec2a577591 (patch)
treebaeb6f2c17da72248408b8c1d695242b44edda9e /src/lib/dcp_subtitle.cc
parent29f84e2b8785585885e0658bdf9938967547460f (diff)
C++11 tidying.
Diffstat (limited to 'src/lib/dcp_subtitle.cc')
-rw-r--r--src/lib/dcp_subtitle.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/dcp_subtitle.cc b/src/lib/dcp_subtitle.cc
index 6f579b2d3..0943a6b08 100644
--- a/src/lib/dcp_subtitle.cc
+++ b/src/lib/dcp_subtitle.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,6 +18,7 @@
*/
+
#include "dcp_subtitle.h"
#include "exceptions.h"
#include "compose.hpp"
@@ -26,9 +27,12 @@
#include "i18n.h"
-using std::string;
+
using std::exception;
using std::shared_ptr;
+using std::string;
+using std::make_shared;
+
shared_ptr<dcp::SubtitleAsset>
DCPSubtitle::load (boost::filesystem::path file) const
@@ -38,21 +42,21 @@ DCPSubtitle::load (boost::filesystem::path file) const
string smpte_error;
try {
- sc.reset (new dcp::InteropSubtitleAsset (file));
+ sc = make_shared<dcp::InteropSubtitleAsset>(file);
} catch (exception& e) {
interop_error = e.what ();
}
if (!sc) {
try {
- sc.reset (new dcp::SMPTESubtitleAsset (file));
+ sc = make_shared<dcp::SMPTESubtitleAsset>(file);
} catch (exception& e) {
smpte_error = e.what();
}
}
if (!sc) {
- throw FileError (String::compose (_("Could not read subtitles (%1 / %2)"), interop_error, smpte_error), file);
+ throw FileError(String::compose(_("Could not read subtitles (%1 / %2)"), interop_error, smpte_error), file);
}
return sc;