void
Content::set_trim_start (ContentTime t)
{
+ /* video content can modify its start trim */
+ if (video) {
+ video->modify_trim_start (t);
+ }
+
{
boost::mutex::scoped_lock lm (_mutex);
_trim_start = t;
notes.push_back (note);
}
+ /* ...or have a start trim which is an integer number of frames */
+ ContentTime const old_trim = content->trim_start();
+ content->set_trim_start(old_trim);
+ if (old_trim != content->trim_start()) {
+ string note = _("Your project contains video content whose trim was not aligned to a frame boundary.");
+ note += " ";
+ if (old_trim < content->trim_start()) {
+ note += String::compose(
+ _("The file %1 has been trimmed by %2 milliseconds more."),
+ content->path_summary(), ContentTime(content->trim_start() - old_trim).seconds() * 1000
+ );
+ } else {
+ note += String::compose(
+ _("The file %1 has been trimmed by %2 milliseconds less."),
+ content->path_summary(), ContentTime(old_trim - content->trim_start()).seconds() * 1000
+ );
+ }
+ notes.push_back (note);
+ }
+
return content;
}
Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const
{
/* See comment in dcp_to_content_video */
- DCPTime const d = DCPTime::from_frames (f * piece->frc.factor(), piece->frc.dcp) - DCPTime (piece->content->trim_start (), piece->frc);
- return max (DCPTime (), d + piece->content->position ());
+ DCPTime 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
{
pos = pos.ceil (_parent->film()->video_frame_rate());
}
+
+void
+VideoContent::modify_trim_start (ContentTime& trim) const
+{
+ trim = trim.ceil (_parent->video_frame_rate().get());
+}
void add_properties (std::list<UserProperty> &) const;
void modify_position (DCPTime& pos) const;
+ void modify_trim_start (ContentTime& pos) const;
static boost::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr, int);
-Subproject commit cfcc6d6e4e145614460a6c4194d7a9f88cd7b85d
+Subproject commit b5e37d2b241a6397b7d53bef57b49d409adf236a