Purge rint() and use llrint and friends.
[dcpomatic.git] / src / lib / player.cc
index 48b298ff7bf485cb61d49648e6f4d28c0dd7e6e3..a40c65cd54027e7a553ea416098793302f490533 100644 (file)
@@ -218,7 +218,8 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque
                property == VideoContentProperty::VIDEO_SCALE ||
                property == VideoContentProperty::VIDEO_FRAME_RATE ||
                property == VideoContentProperty::VIDEO_FADE_IN ||
-               property == VideoContentProperty::VIDEO_FADE_OUT
+               property == VideoContentProperty::VIDEO_FADE_OUT ||
+               property == VideoContentProperty::COLOUR_CONVERSION
                ) {
 
                Changed (frequent);
@@ -292,8 +293,8 @@ Player::transform_image_subtitles (list<ImageSubtitle> subs) const
                                        true
                                        ),
                                Position<int> (
-                                       rint (_video_container_size.width * i->rectangle.x),
-                                       rint (_video_container_size.height * i->rectangle.y)
+                                       lrint (_video_container_size.width * i->rectangle.x),
+                                       lrint (_video_container_size.height * i->rectangle.y)
                                        )
                                )
                        );
@@ -523,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