Replace _floor with _round in dcp_to_content_video. _floor breaks
authorCarl Hetherington <cth@carlh.net>
Tue, 25 Aug 2015 18:35:03 +0000 (19:35 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 25 Aug 2015 20:04:51 +0000 (21:04 +0100)
playback on Win XP 32 as the player keeps requesting the same
frame from the decoder rather than the next one.

src/lib/player.cc

index 3ceaac8c1b667fe39781dc027f5b21a2289e128e..c51f80067fbd87745aa366f202e48a67b858ac65 100644 (file)
@@ -524,10 +524,7 @@ Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
        shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (piece->content);
        DCPTime s = t - piece->content->position ();
        s = min (piece->content->length_after_trim(), s);
-       /* We're returning a frame index here so we need to floor() the conversion since we want to know the frame
-          that contains t, I think
-       */
-       return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start ()).frames_floor (vc->video_frame_rate ());
+       return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start ()).frames_round (vc->video_frame_rate ());
 }
 
 DCPTime