LOG_WARNING ("Crazy timestamp %s", to_string (ct));
}
- update_position (_audio_position, ct);
+ audio->set_position (ct);
/* Give this data provided there is some, and its time is sane */
if (ct >= ContentTime() && data->frames() > 0) {
shared_ptr<ImageProxy> (new RawImageProxy (image)),
llrint (pts * _ffmpeg_content->active_video_frame_rate ())
);
- update_position (_video_position, ContentTime::from_seconds (pts));
+ video->set_position (ContentTime::from_seconds (pts));
} else {
LOG_WARNING_NC ("Dropping frame without PTS");
}
FFmpegSubtitlePeriod sub_period = subtitle_period (sub);
ContentTimePeriod period;
period.from = sub_period.from + _pts_offset;
- update_position (_subtitle_position, period.from);
+ subtitle->set_position (period.from);
if (sub_period.to) {
/* We already know the subtitle period `to' time */
period.to = sub_period.to.get() + _pts_offset;
subtitle->give_text (period, i);
}
}
-
-void
-FFmpegDecoder::update_position (optional<ContentTime>& current, ContentTime p)
-{
- /* current should err on the side of being too big, as then there is less
- chance that we will erroneously decide not to seek when current > request.
- */
- if (!current) {
- current = p;
- } else {
- current = max (*current, p);
- }
-}