Remove unused methods: this should happen regardless.
authorCarl Hetherington <cth@carlh.net>
Tue, 23 Jun 2020 20:41:51 +0000 (22:41 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 1 Dec 2020 15:38:52 +0000 (16:38 +0100)
src/lib/player.cc
src/lib/player.h

index 3d6b2615676940ca848fb641cc1ebd79c6189adb..5e04271e271ede17bb8adf54ab5a4a4c4ceec2e4 100644 (file)
@@ -386,13 +386,10 @@ Player::black_player_video_frame (Eyes eyes) const
        );
 }
 
-Frame
-Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
-{
-       DCPTime s = t - piece->position ();
-       s = min (piece->content->length_after_trim(_film), s);
-       s = max (DCPTime(), s + DCPTime (piece->content->trim_start(), piece->frc));
 
+DCPTime
+Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const
+{
        /* It might seem more logical here to convert s to a ContentTime (using the FrameRateChange)
           then convert that ContentTime to frames at the content's rate.  However this fails for
           situations like content at 29.9978733fps, DCP at 30fps.  The accuracy of the Time type is not
@@ -400,25 +397,10 @@ Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 
           Instead we convert the DCPTime using the DCP video rate then account for any skip/repeat.
        */
-       return s.frames_floor (piece->frc.dcp) / piece->frc.factor ();
-}
-
-DCPTime
-Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const
-{
-       /* See comment in dcp_to_content_video */
        DCPTime const d = DCPTime::from_frames (f * piece->frc.factor(), piece->frc.dcp) - DCPTime(piece->content->trim_start(), piece->frc);
        return d + piece->position();
 }
 
-Frame
-Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const
-{
-       DCPTime s = t - piece->position ();
-       s = min (piece->content->length_after_trim(_film), s);
-       /* See notes in dcp_to_content_video */
-       return max (DCPTime (), DCPTime (piece->content->trim_start (), piece->frc) + s).frames_floor (_film->audio_frame_rate ());
-}
 
 DCPTime
 Player::resampled_audio_to_dcp (shared_ptr<const Piece> piece, Frame f) const
index 6b03d4625f9d882b8035078b0d60f00169bdf7b8..eb1f34f5988a04d939b844697a9a70c2cf7c4d0c 100644 (file)
@@ -126,9 +126,7 @@ private:
        void film_change (ChangeType, Film::Property);
        void playlist_change (ChangeType);
        void playlist_content_change (ChangeType, int, bool);
-       Frame dcp_to_content_video (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
        dcpomatic::DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
-       Frame dcp_to_resampled_audio (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
        dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
        dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
        dcpomatic::DCPTime content_time_to_dcp (boost::shared_ptr<const Piece> piece, dcpomatic::ContentTime t) const;