diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-09 21:41:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-11 22:24:28 +0100 |
| commit | 2671c61a532790ad06c03775b103682233426570 (patch) | |
| tree | 4762fa268bfb7e0d546f34e6d5d24c111668f279 /src/lib | |
| parent | ec06bc09c3ee7e69fb99056d8b665b733021e6a7 (diff) | |
Enforce a minimum DCP length of 1 second.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 5556c8e68..5531a198c 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1254,11 +1254,13 @@ Film::move_content_later (shared_ptr<Content> c) _playlist->move_later (shared_from_this(), c); } -/** @return length of the film from time 0 to the last thing on the playlist */ +/** @return length of the film from time 0 to the last thing on the playlist, + * with a minimum length of 1 second. + */ DCPTime Film::length () const { - return _playlist->length(shared_from_this()).ceil(video_frame_rate()); + return max(DCPTime::from_seconds(1), _playlist->length(shared_from_this()).ceil(video_frame_rate())); } int |
