Add some asserts to check for negative trims.
[dcpomatic.git] / src / lib / content.cc
index 49ab944be54c79c3d478469ad09762a9555768fe..b6f7ebbaafa1284bbce648ebe7e58829d0b2fbbe 100644 (file)
@@ -255,6 +255,8 @@ Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit)
 void
 Content::set_trim_start (ContentTime t)
 {
+       DCPOMATIC_ASSERT (t.get() >= 0);
+
        /* video and audio content can modify its start trim */
 
        if (video) {
@@ -278,6 +280,8 @@ Content::set_trim_start (ContentTime t)
 void
 Content::set_trim_end (ContentTime t)
 {
+       DCPOMATIC_ASSERT (t.get() >= 0);
+
        ContentChangeSignaller cc (this, ContentProperty::TRIM_END);
 
        {