When correcting markers keep them just inside the project's duration.
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Mar 2021 15:35:11 +0000 (16:35 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 17 Mar 2021 15:35:11 +0000 (16:35 +0100)
src/wx/markers_dialog.cc

index 11a76548e002e049b281d8ffc25d6efadea25d77..6658fdb4545fb6eb12736a18a04aecf34caa407f 100644 (file)
@@ -91,10 +91,11 @@ private:
        {
                auto f = film.lock ();
                DCPOMATIC_ASSERT (f);
        {
                auto f = film.lock ();
                DCPOMATIC_ASSERT (f);
-               auto tc = timecode->get(f->video_frame_rate());
+               auto vfr = f->video_frame_rate();
+               auto tc = timecode->get(vfr);
                if (tc >= f->length()) {
                if (tc >= f->length()) {
-                       tc = f->length();
-                       timecode->set (tc, f->video_frame_rate());
+                       tc = f->length() - DCPTime::from_frames(1, vfr);
+                       timecode->set (tc, vfr);
                }
                if (checkbox->GetValue()) {
                        f->set_marker (type, tc);
                }
                if (checkbox->GetValue()) {
                        f->set_marker (type, tc);