summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-06-23 23:08:39 +0200
committerCarl Hetherington <cth@carlh.net>2020-12-01 16:39:41 +0100
commitd78278fd980976885f49dfe8454dbf58e8377df9 (patch)
tree42edaf9a756aeb32e6b187fc0cb7ac0907a8b25e
parent8ddf89d95d0f8c6b970d73e33f40fd1e5b932664 (diff)
FrameRateChange and video_use.
-rw-r--r--src/lib/piece.cc7
-rw-r--r--src/lib/piece.h5
-rw-r--r--src/lib/player.cc6
3 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/piece.cc b/src/lib/piece.cc
index ba5da7f78..9fcf40834 100644
--- a/src/lib/piece.cc
+++ b/src/lib/piece.cc
@@ -174,3 +174,10 @@ Piece::reference_audio () const
shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(_content[0]);
return dcp && dcp->reference_audio();
}
+
+
+bool
+Piece::video_use () const
+{
+ return _content[0]->video && _content[0]->video->use();
+}
diff --git a/src/lib/piece.h b/src/lib/piece.h
index cd0d3f8fc..845b7fbdc 100644
--- a/src/lib/piece.h
+++ b/src/lib/piece.h
@@ -45,6 +45,11 @@ public:
dcpomatic::DCPTime position () const;
dcpomatic::DCPTime end (boost::shared_ptr<const Film> film) const;
+ FrameRateChange frame_rate_change () const {
+ return _frc;
+ }
+
+ bool video_use () const;
dcpomatic::DCPTime content_video_to_dcp (Frame f) const;
dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Film> film, Frame f) const;
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 26bcd7df8..0af9f286f 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -737,17 +737,17 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
return;
}
- if (!piece->content->video->use()) {
+ if (!piece->video_use()) {
return;
}
- FrameRateChange frc (_film, piece->content);
+ FrameRateChange const frc = piece->frame_rate_change();
if (frc.skip && (video.frame % 2) == 1) {
return;
}
/* Time of the first frame we will emit */
- DCPTime const time = content_video_to_dcp (piece, video.frame);
+ DCPTime const time = piece->content_video_to_dcp (video.frame);
LOG_DEBUG_PLAYER("Received video frame %1 at %2", video.frame, to_string(time));
/* Discard if it's before the content's period or the last accurate seek. We can't discard