summaryrefslogtreecommitdiff
path: root/src/lib/video_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-11 10:31:18 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-11 10:31:18 +0000
commitea910e250a0fb3b0ad3ce0cf32dd27b24c17cd1d (patch)
tree32119d2a04532d3162c656df7c7e715b289c6e61 /src/lib/video_content.cc
parent3e5df964ada49e10a880a200c985cc309ccecb64 (diff)
Various work on better seeking (and seeking of audio).
Diffstat (limited to 'src/lib/video_content.cc')
-rw-r--r--src/lib/video_content.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 0a19ffd69..c61a2455f 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -351,7 +351,8 @@ VideoContent::video_size_after_crop () const
}
/** @param t A time offset from the start of this piece of content.
- * @return Corresponding frame index.
+ * @return Corresponding frame index, rounded up so that the frame index
+ * is that of the next complete frame which starts after `t'.
*/
VideoContent::Frame
VideoContent::time_to_content_video_frames (Time t) const
@@ -359,11 +360,12 @@ VideoContent::time_to_content_video_frames (Time t) const
shared_ptr<const Film> film = _film.lock ();
assert (film);
- FrameRateConversion frc (video_frame_rate(), film->video_frame_rate());
-
/* Here we are converting from time (in the DCP) to a frame number in the content.
Hence we need to use the DCP's frame rate and the double/skip correction, not
- the source's rate.
+ the source's rate; source rate will be equal to DCP rate if we ignore
+ double/skip. There's no need to call Film::active_frame_rate_change() here
+ as we know that we are it (since we're video).
*/
- return t * film->video_frame_rate() / (frc.factor() * TIME_HZ);
+ FrameRateChange frc (video_frame_rate(), film->video_frame_rate());
+ return ceil (t * film->video_frame_rate() / (frc.factor() * TIME_HZ));
}