From d39e59cbfff3b886af7a7d9c9c48f3f7f5928e43 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 5 Jun 2014 23:56:26 +0100 Subject: A couple of fixes to hangs when over-trimming content. --- src/lib/content.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/content.cc') diff --git a/src/lib/content.cc b/src/lib/content.cc index 1ec607d39..4cdb23e83 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -36,6 +36,7 @@ using std::set; using std::list; using std::cout; using std::vector; +using std::max; using boost::shared_ptr; using libdcp::raw_convert; @@ -211,7 +212,7 @@ Content::technical_summary () const Time Content::length_after_trim () const { - return full_length() - trim_start() - trim_end(); + return max (0L, full_length() - trim_start() - trim_end()); } /** @param t A time relative to the start of this content (not the position). -- cgit v1.2.3 From c7dbefa410221effc189810611df60e5be1ffcc0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 6 Jun 2014 00:49:09 +0100 Subject: Attempted OS X build fix. --- src/lib/content.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/content.cc') diff --git a/src/lib/content.cc b/src/lib/content.cc index 4cdb23e83..7966219ff 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -212,7 +212,7 @@ Content::technical_summary () const Time Content::length_after_trim () const { - return max (0L, full_length() - trim_start() - trim_end()); + return max (int64_t (0), full_length() - trim_start() - trim_end()); } /** @param t A time relative to the start of this content (not the position). -- cgit v1.2.3