projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c41fcae
)
Enforce minimum reel length when using REELTYPE_BY_LENGTH.
author
Carl Hetherington
<cth@carlh.net>
Mon, 9 Mar 2020 20:33:13 +0000
(21:33 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 11 Mar 2020 21:24:28 +0000
(22:24 +0100)
src/lib/film.cc
patch
|
blob
|
history
diff --git
a/src/lib/film.cc
b/src/lib/film.cc
index 691ef58dab1012f0b2dfb8c96d7b141e7b34ffc2..5556c8e680ebd39595db3a4748aef4b81e14692b 100644
(file)
--- a/
src/lib/film.cc
+++ b/
src/lib/film.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012-20
19
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-20
20
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-1654,8
+1654,10
@@
Film::reels () const
case REELTYPE_BY_LENGTH:
{
DCPTime current;
case REELTYPE_BY_LENGTH:
{
DCPTime current;
- /* Integer-divide reel length by the size of one frame to give the number of frames per reel */
- Frame const reel_in_frames = _reel_length / ((j2k_bandwidth() / video_frame_rate()) / 8);
+ /* Integer-divide reel length by the size of one frame to give the number of frames per reel,
+ * making sure we don't go less than 1s long.
+ */
+ Frame const reel_in_frames = max(_reel_length / ((j2k_bandwidth() / video_frame_rate()) / 8), static_cast<Frame>(video_frame_rate()));
while (current < len) {
DCPTime end = min (len, current + DCPTime::from_frames (reel_in_frames, video_frame_rate ()));
p.push_back (DCPTimePeriod (current, end));
while (current < len) {
DCPTime end = min (len, current + DCPTime::from_frames (reel_in_frames, video_frame_rate ()));
p.push_back (DCPTimePeriod (current, end));