From de77e42f106342e1668e8948e28d6974ef44b61c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 15 Jul 2025 02:20:36 +0200 Subject: Don't process unnecessary video frame rate changes. This inadvertently fixes a bug where multiple pieces of caption content would be added to the project sequentially, but then immediately re-arranged to be at the same time. --- src/lib/film.cc | 4 ++++ test/vf_test.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/lib/film.cc b/src/lib/film.cc index 9dcc21918..ddb469f3a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1212,6 +1212,10 @@ Film::set_video_bit_rate(VideoEncoding encoding, int64_t bit_rate) void Film::set_video_frame_rate(int f, bool user_explicit) { + if (_video_frame_rate == f) { + return; + } + FilmChangeSignaller ch(this, FilmProperty::VIDEO_FRAME_RATE); _video_frame_rate = f; if (user_explicit) { diff --git a/test/vf_test.cc b/test/vf_test.cc index 33e33f4be..61024982a 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -387,6 +387,7 @@ BOOST_AUTO_TEST_CASE(test_referencing_ov_with_subs_when_adding_ccaps) auto ov_dcp = make_shared(ov->dir(ov->dcp_name(false))); auto vf = new_test_film(name + "_vf", { ov_dcp, ccaps }); ccaps->text[0]->set_type(TextType::CLOSED_CAPTION); + ccaps->set_position(vf, dcpomatic::DCPTime()); string why_not; BOOST_CHECK(ov_dcp->can_reference_text(vf, TextType::OPEN_SUBTITLE, why_not)); @@ -414,6 +415,7 @@ BOOST_AUTO_TEST_CASE(test_duplicate_font_id_in_vf) ov_dcp->set_reference_video(true); ov_dcp->text[0]->set_use(true); ccaps->text[0]->set_type(TextType::CLOSED_CAPTION); + ccaps->set_position(vf, dcpomatic::DCPTime()); string why_not; BOOST_CHECK_MESSAGE(ov_dcp->can_reference_text(vf, TextType::OPEN_SUBTITLE, why_not), why_not); ov_dcp->set_reference_text(TextType::OPEN_SUBTITLE, true); @@ -566,6 +568,7 @@ BOOST_AUTO_TEST_CASE(vf_subs_get_font_from_ov) vf->set_reel_type(ReelType::BY_VIDEO_CONTENT); subs2->text[0]->set_language(dcp::LanguageTag("de")); subs2->text[0]->get_font("")->set_file("test/data/Inconsolata-VF.ttf"); + subs2->set_position(vf, dcpomatic::DCPTime()); ov_dcp->set_reference_video(true); ov_dcp->set_reference_audio(true); -- cgit v1.2.3