From 94618a724124cbf5fe9f0b47a3fdce601fcd5581 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 1 Apr 2024 01:04:41 +0200 Subject: Fix hanging/overlapping dvb subtitles (#2792). This reverts a change made in 8ca6fd6d97e6d42492afddb655fa85130946853c "Fix doubled subtitles if subtitle stop times are specified." That change breaks the case where a subtitle _does_ have a stop time, but it's wrong (30s from the start time) and we want the next subtitle to clear the previous one. I can't now see how reverting this could cause doubled subtitles, so maybe that problem wlil come back. At least now there's a test for #2792. --- src/lib/ffmpeg_decoder.cc | 2 +- test/subtitle_timing_test.cc | 71 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 7f7a07863..6130d8e5f 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -668,11 +668,11 @@ FFmpegDecoder::decode_and_process_subtitle_packet (AVPacket* packet) */ ContentTime from; from = sub_period.from + _pts_offset; + _have_current_subtitle = true; if (sub_period.to) { _current_subtitle_to = *sub_period.to + _pts_offset; } else { _current_subtitle_to = optional(); - _have_current_subtitle = true; } ContentBitmapText bitmap_text(from); diff --git a/test/subtitle_timing_test.cc b/test/subtitle_timing_test.cc index 79cc68849..8bb18f304 100644 --- a/test/subtitle_timing_test.cc +++ b/test/subtitle_timing_test.cc @@ -21,8 +21,13 @@ #include "lib/content.h" #include "lib/content_factory.h" +#include "lib/content_text.h" +#include "lib/dcpomatic_time.h" #include "lib/film.h" +#include "lib/ffmpeg_content.h" +#include "lib/ffmpeg_decoder.h" #include "lib/text_content.h" +#include "lib/text_decoder.h" #include "lib/video_content.h" #include "test.h" #include @@ -33,6 +38,9 @@ #include +using std::dynamic_pointer_cast; + + BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change) { Cleanup cl; @@ -72,3 +80,66 @@ BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change) cl.run(); } + +BOOST_AUTO_TEST_CASE(dvb_subtitles_replace_the_last) +{ + /* roh.mkv contains subtitles that come out of FFmpeg with incorrect stop times (30s + * after the start, which seems to be some kind of DVB "standard" timeout). + * Between actual subtitles it contains blanks that are apparently supposed to clear + * the previous subtitle. Make sure that happens. + */ + auto content = content_factory(TestPaths::private_data() / "roh.mkv"); + BOOST_REQUIRE(!content.empty()); + auto film = new_test_film2("dvb_subtitles_replace_the_last", { content[0] }); + + FFmpegDecoder decoder(film, dynamic_pointer_cast(content[0]), false); + BOOST_REQUIRE(!decoder.text.empty()); + + struct Event { + std::string type; + dcpomatic::ContentTime time; + + bool operator==(Event const& other) const { + return type == other.type && time == other.time; + } + }; + + std::vector events; + + auto start = [&events](ContentBitmapText text) { + events.push_back({"start", text.from()}); + }; + + auto stop = [&events](dcpomatic::ContentTime time) { + if (!events.empty() && events.back().type == "stop") { + /* We'll get a bad (too-late) stop time, then the correct one + * when the "clearing" subtitle arrives. + */ + events.pop_back(); + } + events.push_back({"stop", time}); + }; + + decoder.text.front()->BitmapStart.connect(start); + decoder.text.front()->Stop.connect(stop); + + while (!decoder.pass()) {} + + using dcpomatic::ContentTime; + + std::vector correct = { + { "start", ContentTime(439872) }, // 4.582000s actual subtitle #1 + { "stop", ContentTime(998400) }, // 10.400000s stop caused by incoming blank + { "start", ContentTime(998400) }, // 10.400000s blank + { "stop", ContentTime(1141248) }, // 11.888000s stop caused by incoming subtitle #2 + { "start", ContentTime(1141248) }, // 11.888000s subtitle #2 + { "stop", ContentTime(1455936) }, // 15.166000s ... + { "start", ContentTime(1455936) }, // 15.166000s + { "stop", ContentTime(1626816) }, // 16.946000s + { "start", ContentTime(1626816) }, // 16.946000s + }; + + BOOST_REQUIRE(events.size() > correct.size()); + BOOST_CHECK(std::vector(events.begin(), events.begin() + correct.size()) == correct); +} + -- cgit v1.2.3 From e3b7f39d7fb90f2efd6dc34d8531007d932661bd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 Apr 2024 23:13:00 +0200 Subject: Don't use --target-macos-arm64 any more, since it's not supported. --- cscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscript b/cscript index 53d2beb7b..4ee24e45d 100644 --- a/cscript +++ b/cscript @@ -589,7 +589,7 @@ def configure_options(target, options, for_package=False): opt += ' --enable-disk' if target.platform == 'osx' and target.arch == 'arm64': - opt += ' --target-macos-arm64 --wx-config=%s/wx-config' % target.bin + opt += ' --wx-config=%s/wx-config' % target.bin return opt -- cgit v1.2.3 From be2deae96d8839ee9bc8190972a50d8acceb8c98 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 17 Apr 2024 23:25:22 +0200 Subject: Bump libdcp for more relaxed CPL parsing (#2797). --- cscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscript b/cscript index 4ee24e45d..dd7f9c44a 100644 --- a/cscript +++ b/cscript @@ -535,7 +535,7 @@ def dependencies(target, options): # Use distro-provided FFmpeg on Arch deps = [] - deps.append(('libdcp', 'v1.8.98')) + deps.append(('libdcp', 'v1.8.99')) deps.append(('libsub', 'v1.6.47')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) -- cgit v1.2.3 From cc411a5ab156565c54282c3e9e0ed044d279de86 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 17 Apr 2024 23:30:12 +0200 Subject: Supporters update. --- src/wx/supporters.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wx/supporters.cc b/src/wx/supporters.cc index 711b6bbad..514b53d7b 100644 --- a/src/wx/supporters.cc +++ b/src/wx/supporters.cc @@ -126,6 +126,7 @@ supported_by.Add (wxT ("Phillip Branford")); supported_by.Add (wxT ("Ingebjørg Braseth")); supported_by.Add (wxT ("Studio Brauneis")); supported_by.Add (wxT ("Thomas Bray")); +supported_by.Add (wxT ("Thomas Bray")); supported_by.Add (wxT ("queerfilm festival Bremen")); supported_by.Add (wxT ("Martin Brenneis")); supported_by.Add (wxT ("Petra-Puk Bresser")); @@ -233,6 +234,7 @@ supported_by.Add (wxT ("Adam Cousins")); supported_by.Add (wxT ("Aria Covamonas")); supported_by.Add (wxT ("Tom Cowan")); supported_by.Add (wxT ("Jill Cox")); +supported_by.Add (wxT ("Tate Cozza")); supported_by.Add (wxT ("Stefano Cravero")); supported_by.Add (wxT ("Phillip Crawford")); supported_by.Add (wxT ("Root && Rust Creative")); @@ -372,6 +374,7 @@ supported_by.Add (wxT ("Marc Fiebig")); supported_by.Add (wxT ("Moshel Film")); supported_by.Add (wxT ("Juli Film")); supported_by.Add (wxT ("Pató Film")); +supported_by.Add (wxT ("HisStory Film")); supported_by.Add (wxT ("Hoppe Film")); supported_by.Add (wxT ("“How to Successfully Fail in Hollywood” Film")); supported_by.Add (wxT ("Hamann Film")); @@ -443,6 +446,7 @@ supported_by.Add (wxT ("Francesca Garau")); supported_by.Add (wxT ("Jordi Miró Garcia")); supported_by.Add (wxT ("Francisco Montoro Garcia")); supported_by.Add (wxT ("Stefano Gariglio")); +supported_by.Add (wxT ("Tom Garner")); supported_by.Add (wxT ("Bethwyn Garswood")); supported_by.Add (wxT ("Andris Gauja")); supported_by.Add (wxT ("DocCollection GbR")); @@ -569,6 +573,7 @@ supported_by.Add (wxT ("Shinya Isobe")); supported_by.Add (wxT ("Theodore Ivanov")); supported_by.Add (wxT ("Julien Ivanowich")); supported_by.Add (wxT ("Denis Ivashvkevych")); +supported_by.Add (wxT ("June Nho Ivers")); supported_by.Add (wxT ("Emilia Izquierdo")); supported_by.Add (wxT ("Mahboobani Jackie")); supported_by.Add (wxT ("Alexzandra Jackson")); @@ -813,6 +818,7 @@ supported_by.Add (wxT ("Kenjo McCurtain")); supported_by.Add (wxT ("Dawn McElligott")); supported_by.Add (wxT ("Caitlin Mcgrath")); supported_by.Add (wxT ("Neil McGrath")); +supported_by.Add (wxT ("Tom Mcintire")); supported_by.Add (wxT ("Andrew McKee")); supported_by.Add (wxT ("Gordon McLeod")); supported_by.Add (wxT ("Britt McTammany")); @@ -908,6 +914,7 @@ supported_by.Add (wxT ("Didier Oriol")); supported_by.Add (wxT ("Kevin Orman")); supported_by.Add (wxT ("George Orr")); supported_by.Add (wxT ("orwoid.com")); +supported_by.Add (wxT ("Neil Oseman")); supported_by.Add (wxT ("Danilo Marichal Osorio")); supported_by.Add (wxT ("Norbert Ostendorf")); supported_by.Add (wxT ("Peter Östlund")); @@ -927,6 +934,7 @@ supported_by.Add (wxT ("Christian Passeri")); supported_by.Add (wxT ("Sharad Patel")); supported_by.Add (wxT ("Panagiotis Patsiaouras")); supported_by.Add (wxT ("Anand Patwardhan")); +supported_by.Add (wxT ("Tomaz Pavkovic")); supported_by.Add (wxT ("Stanko Pavlica")); supported_by.Add (wxT ("Konstantinos Pavlidis")); supported_by.Add (wxT ("Natalie Peart")); @@ -985,6 +993,7 @@ supported_by.Add (wxT ("Pentimenti Productions")); supported_by.Add (wxT ("Hitman Productions")); supported_by.Add (wxT ("WLFK Productions")); supported_by.Add (wxT ("Ceridwen Productions")); +supported_by.Add (wxT ("ZooTime Productions")); supported_by.Add (wxT ("A Tractor Productions")); supported_by.Add (wxT ("Second Wind Productions")); supported_by.Add (wxT ("Locomotive Productions")); @@ -1060,6 +1069,7 @@ supported_by.Add (wxT ("Objectif 13 S.C.S.")); supported_by.Add (wxT ("Neil Sadwelkar")); supported_by.Add (wxT ("Hakan Sahin")); supported_by.Add (wxT ("Sebastien Saint-Cricq")); +supported_by.Add (wxT ("Milena Salazar")); supported_by.Add (wxT ("Lasse Salling")); supported_by.Add (wxT ("Community TV Salzburg")); supported_by.Add (wxT ("Keith Sanborn")); -- cgit v1.2.3 From d5f5a9d9f5635f84a5e372181dea1c7cbb0ae732 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 18 Apr 2024 10:12:25 +0200 Subject: Add missing GUI-side verification note descriptions. --- src/wx/verify_dcp_dialog.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index c77f68ea1..c7a32e5dd 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -449,6 +449,12 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job case dcp::VerificationNote::Code::EMPTY_CONTENT_VERSION_LABEL_TEXT: add(i, _("The in a in CPL %id is empty")); break; + case dcp::VerificationNote::Code::INVALID_CPL_NAMESPACE: + add(i, _("The CPL %f has an invalid namespace %n")); + break; + case dcp::VerificationNote::Code::MISSING_CPL_CONTENT_VERSION: + add(i, _("The CPL %n has no tag")); + break; } } -- cgit v1.2.3