Fix incorrect use of FrameRateChange::factor(); if we are skipping, for
authorCarl Hetherington <cth@carlh.net>
Mon, 5 Jan 2015 14:14:43 +0000 (14:14 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 5 Jan 2015 14:14:43 +0000 (14:14 +0000)
example, factor will be 0.5 and so to convert some frames in the DCP
to frames in the content we must divide by factor (i.e. multiply by 2)
to get the content frame.

src/lib/player.cc

index 36b13d1059ad7fdddae719b1817392f93cf6bba3..4c9042743da95658426a4b1b789ea2f8a431a93d 100644 (file)
@@ -321,7 +321,7 @@ Player::get_video (DCPTime time, bool accurate)
        if (!_have_valid_pieces) {
                setup_pieces ();
        }
-       
+
        list<shared_ptr<Piece> > ov = overlaps<VideoContent> (
                time,
                time + DCPTime::from_frames (1, _film->video_frame_rate ())
@@ -488,13 +488,13 @@ Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
        s = DCPTime (min (piece->content->length_after_trim().get(), s.get()));
 
        /* Convert this to the content frame */
-       return DCPTime (s + piece->content->trim_start()).frames (_film->video_frame_rate()) * piece->frc.factor ();
+       return DCPTime (s + piece->content->trim_start()).frames (_film->video_frame_rate()) / piece->frc.factor ();
 }
 
 DCPTime
 Player::content_video_to_dcp (shared_ptr<const Piece> piece, VideoFrame f) const
 {
-       DCPTime t = DCPTime::from_frames (f / piece->frc.factor (), _film->video_frame_rate()) - piece->content->trim_start () + piece->content->position ();
+       DCPTime t = DCPTime::from_frames (f * piece->frc.factor (), _film->video_frame_rate()) - piece->content->trim_start () + piece->content->position ();
        if (t < DCPTime ()) {
                t = DCPTime ();
        }