From c8a036eb727ceddc64a0304d781c916eb952c001 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 Jun 2022 09:58:16 +0200 Subject: Set up TextDecoder position based on the time that the next thing will be emitted, instead of the time that the last thing was (#2268). This is to avoid problems with the example shown in the test, where just because a subtitle in source A comes before a subtitle in source B, source A is pass()ed next and may then emit a subtitle which should be after the next one in B. --- src/lib/text_decoder.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/text_decoder.h') diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index 607d9e194..5f01c5b1f 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -42,11 +42,7 @@ class Image; class TextDecoder : public DecoderPart { public: - TextDecoder ( - Decoder* parent, - std::shared_ptr, - dcpomatic::ContentTime first - ); + TextDecoder (Decoder* parent, std::shared_ptr); boost::optional position (std::shared_ptr) const override { return _position; @@ -60,6 +56,8 @@ public: void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle); void emit_stop (dcpomatic::ContentTime to); + void maybe_set_position (dcpomatic::ContentTime position); + void seek () override; std::shared_ptr content () const { -- cgit v1.2.3