FrameRateChange and video_use.
authorCarl Hetherington <cth@carlh.net>
Tue, 23 Jun 2020 21:08:39 +0000 (23:08 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 1 Dec 2020 15:39:41 +0000 (16:39 +0100)
src/lib/piece.cc
src/lib/piece.h
src/lib/player.cc

index ba5da7f785fe86473d86516344825c091b989f45..9fcf40834bb1669f735d0508dc3f4faa4fb0faba 100644 (file)
@@ -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();
+}
index cd0d3f8fc0df27d7f966924c55fedae2a99fd073..845b7fbdca5279dae4d6197f12b0545f2da55132 100644 (file)
@@ -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;
index 26bcd7df8c5daa376b80c5efafa3832e391932d9..0af9f286fe26f5eeed79456b44db25b37fb3e39a 100644 (file)
@@ -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