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/ffmpeg_decoder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index bc7d28d7d..82eccb576 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -93,8 +93,10 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr film, shared_ptronly_text()) { - /* XXX: this time here should be the time of the first subtitle, not 0 */ - text.push_back (make_shared(this, c->only_text(), ContentTime())); + text.push_back (make_shared(this, c->only_text())); + /* XXX: we should be calling maybe_set_position() on this TextDecoder, but we can't easily find + * the time of the first subtitle at this point. + */ } for (auto i: c->ffmpeg_audio_streams()) { -- cgit v1.2.3