}
-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
- 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.
- */
- DCPTime const d = DCPTime::from_frames (f * piece->frc.factor(), piece->frc.dcp) - DCPTime(piece->content->trim_start(), piece->frc);
- return d + piece->position();
-}
-
-
DCPTime
Player::resampled_audio_to_dcp (shared_ptr<const Piece> piece, Frame f) const
{
return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start());
}
-DCPTime
-Player::content_time_to_dcp (shared_ptr<const Piece> piece, ContentTime t) const
-{
- return max (DCPTime (), DCPTime (t - piece->content->trim_start(), piece->frc) + piece->position());
-}
-
list<shared_ptr<Font> >
Player::get_subtitle_fonts ()
{
continue;
}
- DCPTime const t = content_time_to_dcp (i, max(i->decoder->position(), i->content->trim_start()));
+ DCPTime const t = i->content_time_to_dcp (max(i->decoder->position(), i->content->trim_start()));
if (t > i->end(_film)) {
i->done = true;
} else {
}
/* 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);
/* Discard if it's before the content's period or the last accurate seek. We can't discard
if it's after the content's period here as in that case we still need to fill any gap between
dcp::Size scaled_size (width, height);
ps.bitmap.push_back (BitmapText(image->scale(scaled_size, dcp::YUV_TO_RGB_REC601, image->pixel_format(), true, _fast), subtitle.sub.rectangle));
- DCPTime from (content_time_to_dcp (piece, subtitle.from()));
+ DCPTime from (piece->content_time_to_dcp(subtitle.from()));
_active_texts[text->type()].add_from (wc, ps, from);
}
}
PlayerText ps;
- DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
+ DCPTime const from (piece->content_time_to_dcp( subtitle.from()));
if (from > piece->end(_film)) {
return;
return;
}
- DCPTime const dcp_to = content_time_to_dcp (piece, to);
+ DCPTime const dcp_to = piece->content_time_to_dcp(to);
if (dcp_to > piece->end(_film)) {
return;
BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
if (i->content == content) {
- return content_time_to_dcp (i, t);
+ return i->content_time_to_dcp (t);
}
}