Use content video frame rate rather than the DCP one when reading
authorCarl Hetherington <cth@carlh.net>
Fri, 20 Sep 2019 08:22:10 +0000 (10:22 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 27 Sep 2019 20:33:51 +0000 (22:33 +0200)
trim start/end back from the UI.  See #1607.

src/wx/timing_panel.cc

index 06d655b6bde6138a9411f3616e01828b3a9cacbd..0295b0b1d4b07a4c3e64b1c5f8130f416daa8fad 100644 (file)
@@ -405,7 +405,6 @@ TimingPanel::trim_start_changed ()
        optional<FrameRateChange> ref_frc;
        optional<DCPTime> ref_ph;
 
        optional<FrameRateChange> ref_frc;
        optional<DCPTime> ref_ph;
 
-       ContentTime const trim = _trim_start->get (_parent->film()->video_frame_rate ());
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
                if (i->position() <= ph && ph < i->end(_parent->film())) {
 
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
                if (i->position() <= ph && ph < i->end(_parent->film())) {
@@ -418,6 +417,7 @@ TimingPanel::trim_start_changed ()
                        ref_ph = ph - i->position() + DCPTime (i->trim_start(), ref_frc.get());
                }
 
                        ref_ph = ph - i->position() + DCPTime (i->trim_start(), ref_frc.get());
                }
 
+               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 (trim);
        }
 
@@ -438,8 +438,8 @@ TimingPanel::trim_end_changed ()
 
        fv->set_coalesce_player_changes (true);
 
 
        fv->set_coalesce_player_changes (true);
 
-       ContentTime const trim = _trim_end->get (_parent->film()->video_frame_rate ());
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+               ContentTime const trim = _trim_end->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate()));
                i->set_trim_end (trim);
        }
 
                i->set_trim_end (trim);
        }