summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-23 22:14:49 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-07 09:29:58 +0200
commit39055af213d1fd0c437d17422488dd6567706704 (patch)
tree1cbc5949e2610e4d3c0af5bb93b30345391bd2d0 /src
parent413406befbf1a94990add7ff1c67d4792fa54ff4 (diff)
Remove some unused methods.
Diffstat (limited to 'src')
-rw-r--r--src/lib/player.cc38
-rw-r--r--src/lib/player.h2
2 files changed, 8 insertions, 32 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index aebc39346..346a99de3 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -399,47 +399,25 @@ Player::black_player_video_frame (Eyes eyes) const
}
-Frame
-Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
-{
- auto s = t - piece->content->position ();
- s = min (piece->content->length_after_trim(_film), s);
- s = max (DCPTime(), s + DCPTime (piece->content->trim_start(), piece->frc));
-
- /* 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
- enough to distinguish between the two with low values of time (e.g. 3200 in Time units).
-
- 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 */
+ /* See comment in resampled_audio_to_dcp */
auto const d = DCPTime::from_frames (f * piece->frc.factor(), piece->frc.dcp) - DCPTime(piece->content->trim_start(), piece->frc);
return d + piece->content->position();
}
-Frame
-Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const
-{
- auto s = t - piece->content->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
{
- /* See comment in dcp_to_content_video */
+ /* 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
+ enough to distinguish between the two with low values of time (e.g. 3200 in Time units).
+
+ Instead we convert the DCPTime using the DCP video rate then account for any skip/repeat.
+ */
return DCPTime::from_frames (f, _film->audio_frame_rate())
- DCPTime (piece->content->trim_start(), piece->frc)
+ piece->content->position();
diff --git a/src/lib/player.h b/src/lib/player.h
index 0f69deeef..fd3bbf205 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -131,9 +131,7 @@ private:
void film_change (ChangeType, Film::Property);
void playlist_change (ChangeType);
void playlist_content_change (ChangeType, int, bool);
- Frame dcp_to_content_video (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
dcpomatic::DCPTime content_video_to_dcp (std::shared_ptr<const Piece> piece, Frame f) const;
- Frame dcp_to_resampled_audio (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
dcpomatic::DCPTime resampled_audio_to_dcp (std::shared_ptr<const Piece> piece, Frame f) const;
dcpomatic::ContentTime dcp_to_content_time (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
dcpomatic::DCPTime content_time_to_dcp (std::shared_ptr<const Piece> piece, dcpomatic::ContentTime t) const;