X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent.cc;h=21e49a2c955ae7e74091ec5c1a43f4e9e238b857;hb=391d85619ac19a2a93696ddc35c222eb9bb5d9d6;hp=b6678cb4d9e7e9555773beb8746754755f0673e9;hpb=39bc73fe192f932ed6695eb87b19de446e8b4f55;p=dcpomatic.git diff --git a/src/lib/content.cc b/src/lib/content.cc index b6678cb4d..21e49a2c9 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -31,15 +31,16 @@ #include "ui_signaller.h" #include "exceptions.h" #include "film.h" +#include "safe_stringstream.h" #include "i18n.h" using std::string; -using std::stringstream; using std::set; using std::list; using std::cout; using std::vector; +using std::max; using boost::shared_ptr; using dcp::raw_convert; @@ -215,7 +216,7 @@ Content::technical_summary () const DCPTime Content::length_after_trim () const { - return full_length() - trim_start() - trim_end(); + return max (DCPTime (), full_length() - trim_start() - trim_end()); } /** @return string which includes everything about how this content affects @@ -224,7 +225,7 @@ Content::length_after_trim () const string Content::identifier () const { - stringstream s; + SafeStringStream s; s << Content::digest() << "_" << position().get()