diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-11-22 02:16:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-11-26 00:09:27 +0100 |
| commit | 5799460dc38bafa1da1ce9f7bf43621d3fadf442 (patch) | |
| tree | a4666f4bf8f99f29716e8d68113320426b0a1c95 /src | |
| parent | aaf6845e130ac208cee524536b67c54bd1ce8ed9 (diff) | |
Noisy change to get film into AudioContent::modify_trim_start().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/audio_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/audio_content.h | 2 | ||||
| -rw-r--r-- | src/lib/content.cc | 8 | ||||
| -rw-r--r-- | src/lib/content.h | 4 | ||||
| -rw-r--r-- | src/lib/dcp_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 4 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/playlist.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 4 | ||||
| -rw-r--r-- | src/lib/video_content.h | 2 | ||||
| -rw-r--r-- | src/lib/video_mxf_content.cc | 2 | ||||
| -rw-r--r-- | src/wx/content_menu.cc | 4 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/timing_panel.cc | 4 |
15 files changed, 24 insertions, 22 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index e363cfebd..05c388a3e 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -420,7 +420,7 @@ AudioContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const void -AudioContent::modify_trim_start (ContentTime& trim) const +AudioContent::modify_trim_start(shared_ptr<const Film> film, ContentTime& trim) const { DCPOMATIC_ASSERT (!_streams.empty()); /* XXX: we're in trouble if streams have different rates */ diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 82a9de041..bd5a25b98 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -101,7 +101,7 @@ public: void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty> &) const; void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const; - void modify_trim_start (dcpomatic::ContentTime& pos) const; + void modify_trim_start(std::shared_ptr<const Film> film, dcpomatic::ContentTime& pos) const; /** @param frame frame within the whole (untrimmed) content. * @param frame_rate The frame rate of the audio (it may have been resampled). diff --git a/src/lib/content.cc b/src/lib/content.cc index 9969213ac..e77a3638c 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -242,7 +242,7 @@ Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit) void -Content::set_trim_start (ContentTime t) +Content::set_trim_start(shared_ptr<const Film> film, ContentTime t) { DCPOMATIC_ASSERT (t.get() >= 0); @@ -254,7 +254,7 @@ Content::set_trim_start (ContentTime t) /* See note in ::set_position */ if (!video && audio) { - audio->modify_trim_start (t); + audio->modify_trim_start(film, t); } ContentChangeSignaller cc (this, ContentProperty::TRIM_START); @@ -402,7 +402,7 @@ Content::reel_split_points (shared_ptr<const Film>) const void -Content::set_video_frame_rate (double r) +Content::set_video_frame_rate(shared_ptr<const Film> film, double r) { ContentChangeSignaller cc (this, ContentProperty::VIDEO_FRAME_RATE); @@ -416,7 +416,7 @@ Content::set_video_frame_rate (double r) /* Make sure trim is still on a frame boundary */ if (video) { - set_trim_start (trim_start()); + set_trim_start(film, trim_start()); } } diff --git a/src/lib/content.h b/src/lib/content.h index ba4c23ddf..5b804b331 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -153,7 +153,7 @@ public: return _position; } - void set_trim_start (dcpomatic::ContentTime); + void set_trim_start(std::shared_ptr<const Film> film, dcpomatic::ContentTime); dcpomatic::ContentTime trim_start () const { boost::mutex::scoped_lock lm (_mutex); @@ -179,7 +179,7 @@ public: return _video_frame_rate; } - void set_video_frame_rate (double r); + void set_video_frame_rate(std::shared_ptr<const Film> film, double r); void unset_video_frame_rate (); double active_video_frame_rate (std::shared_ptr<const Film> film) const; diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 2bbeba8c7..3cc724b8e 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -229,7 +229,7 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) boost::mutex::scoped_lock lm (_mutex); video = make_shared<VideoContent>(this); } - video->take_from_examiner (examiner); + video->take_from_examiner(film, examiner); set_default_colour_conversion (); } diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index b111bdb2a..8908d34e6 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -62,7 +62,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) auto iop = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(sc); auto smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(sc); if (smpte) { - set_video_frame_rate (smpte->edit_rate().numerator); + set_video_frame_rate(film, smpte->edit_rate().numerator); } boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 496ad5f1a..515b58cd0 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -273,7 +273,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) if (examiner->has_video ()) { video.reset (new VideoContent (this)); - video->take_from_examiner (examiner); + video->take_from_examiner(film, examiner); } auto first_path = path (0); @@ -332,7 +332,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) /* FFmpeg has detected this file as 29.97 and the examiner thinks it is using "soft" 2:3 pulldown (telecine). * This means we can treat it as a 23.976fps file. */ - set_video_frame_rate (24000.0 / 1001); + set_video_frame_rate(film, 24000.0 / 1001); video->set_length (video->length() * 24.0 / 30); } } diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index d8f482a3b..1415fef24 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -136,7 +136,7 @@ ImageContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) Content::examine (film, job); auto examiner = make_shared<ImageExaminer>(film, shared_from_this(), job); - video->take_from_examiner (examiner); + video->take_from_examiner(film, examiner); set_default_colour_conversion (); } diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index c18a43882..5f26b94f3 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -234,7 +234,7 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in /* ...or have a start trim which is an integer number of frames */ auto const old_trim = content->trim_start(); - content->set_trim_start(old_trim); + content->set_trim_start(film, 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 += " "; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index ca0076fba..c10a94f43 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -305,7 +305,7 @@ VideoContent::as_xml (xmlpp::Node* node) const } void -VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d) +VideoContent::take_from_examiner(shared_ptr<const Film> film, shared_ptr<VideoExaminer> d) { /* These examiner calls could call other content methods which take a lock on the mutex */ auto const vs = d->video_size (); @@ -332,7 +332,7 @@ VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d) LOG_GENERAL ("Video length obtained from header as %1 frames", _length); if (d->video_frame_rate()) { - _parent->set_video_frame_rate (d->video_frame_rate().get()); + _parent->set_video_frame_rate(film, d->video_frame_rate().get()); } } diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 7214d35e4..cff141e4e 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -211,7 +211,7 @@ public: void set_length (Frame); - void take_from_examiner (std::shared_ptr<VideoExaminer>); + void take_from_examiner(std::shared_ptr<const Film> film, std::shared_ptr<VideoExaminer>); void add_properties (std::list<UserProperty> &) const; void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const; diff --git a/src/lib/video_mxf_content.cc b/src/lib/video_mxf_content.cc index c6165172a..9adca5a2d 100644 --- a/src/lib/video_mxf_content.cc +++ b/src/lib/video_mxf_content.cc @@ -94,7 +94,7 @@ VideoMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) video.reset (new VideoContent (this)); auto examiner = make_shared<VideoMXFExaminer>(shared_from_this()); - video->take_from_examiner (examiner); + video->take_from_examiner(film, examiner); video->unset_colour_conversion (); } diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index cae56283b..32a4c9ac9 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -483,7 +483,9 @@ ContentMenu::advanced () } if (dialog->video_frame_rate()) { - content->set_video_frame_rate(*dialog->video_frame_rate()); + auto film = _film.lock(); + DCPOMATIC_ASSERT(film); + content->set_video_frame_rate(film, *dialog->video_frame_rate()); } else { content->unset_video_frame_rate(); } diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index d9400e34c..bf02e3930 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -660,7 +660,7 @@ ContentPanel::add_folder(boost::filesystem::path folder) return; } - ic->set_video_frame_rate (frame_rate); + ic->set_video_frame_rate(_film, frame_rate); } _film->examine_and_add_content (i); diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index a78e3bdd4..5b8adc495 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -365,7 +365,7 @@ TimingPanel::trim_start_changed () } ContentTime const trim = _trim_start->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate())); - i->set_trim_start (trim); + i->set_trim_start(_parent->film(), trim); } if (ref) { @@ -440,7 +440,7 @@ TimingPanel::trim_start_to_playhead_clicked () for (auto i: _parent->selected()) { if (i->position() < ph && ph < i->end(film)) { FrameRateChange const frc = film->active_frame_rate_change (i->position()); - i->set_trim_start (i->trim_start() + ContentTime (ph - i->position(), frc)); + i->set_trim_start(film, i->trim_start() + ContentTime(ph - i->position(), frc)); new_ph = i->position (); } } |
