X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_subtitle.cc;h=c2c3f7f70a6c4215955c82c963090d8ab1a5b8b2;hb=0664b92293ec8dd4fec4015981af7610a9e1984c;hp=f9aa7e0d9f103da6f38d54f5e35621c23c3b6731;hpb=3d6501346b187f35d0f55d16e13f8817f505a82f;p=dcpomatic.git diff --git a/src/lib/dcp_subtitle.cc b/src/lib/dcp_subtitle.cc index f9aa7e0d9..c2c3f7f70 100644 --- a/src/lib/dcp_subtitle.cc +++ b/src/lib/dcp_subtitle.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,17 +18,22 @@ */ + #include "dcp_subtitle.h" #include "exceptions.h" #include "compose.hpp" #include #include +#include #include "i18n.h" -using std::string; + using std::exception; -using boost::shared_ptr; +using std::shared_ptr; +using std::string; +using std::make_shared; + shared_ptr DCPSubtitle::load (boost::filesystem::path file) const @@ -38,21 +43,21 @@ DCPSubtitle::load (boost::filesystem::path file) const string smpte_error; try { - sc.reset (new dcp::InteropSubtitleAsset (file)); + sc = make_shared(file); } catch (exception& e) { interop_error = e.what (); } if (!sc) { try { - sc.reset (new dcp::SMPTESubtitleAsset (file)); + sc = make_shared(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;