TextDecoder::TextDecoder (
Decoder* parent,
- shared_ptr<const TextContent> content,
- ContentTime first
+ shared_ptr<const TextContent> content
)
: DecoderPart (parent)
, _content (content)
- , _position (first)
{
}
TextDecoder::emit_bitmap_start (ContentBitmapText const& bitmap)
{
BitmapStart (bitmap);
- _position = bitmap.from();
+ maybe_set_position(bitmap.from());
}
}
PlainStart(ContentStringText(from, string_texts));
- _position = from;
+ maybe_set_position(from);
}
}
PlainStart(ContentStringText(from, string_texts));
- _position = from;
+ maybe_set_position(from);
}
{
_position = ContentTime ();
}
+
+
+void
+TextDecoder::maybe_set_position (dcpomatic::ContentTime position)
+{
+ if (!_position || position > *_position) {
+ _position = position;
+ }
+}
+