Merge master.
[dcpomatic.git] / src / lib / content.cc
index c4836cfa89a643c1838bc94ef302a99c661d9418..bbbe9b6ce4bdd4dd5ff6b8dcf231c8d08126e253 100644 (file)
@@ -40,6 +40,7 @@ using std::set;
 using std::list;
 using std::cout;
 using std::vector;
+using std::max;
 using boost::shared_ptr;
 using dcp::raw_convert;
 
@@ -79,7 +80,7 @@ Content::Content (shared_ptr<const Film> f, boost::filesystem::path p)
        _paths.push_back (p);
 }
 
-Content::Content (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
+Content::Content (shared_ptr<const Film> f, cxml::ConstNodePtr node)
        : _film (f)
        , _change_signals_frequent (false)
 {
@@ -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