From 6708d52b5c2ff9ccb6ee99f3b793d791bb95f26b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 15 Oct 2015 09:13:33 +0100 Subject: Fix invalid Interop subtitle times in some cases. Use a much higher "timecode rate" (1000 rather than 24) when representing the time of subtitles internally so that accuracy is preserved and we don't end up rounding things up to give out of range results. --- src/lib/subrip_decoder.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/subrip_decoder.cc') diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 2de272481..32d50d86b 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -67,8 +67,8 @@ SubRipDecoder::pass () dcp::Colour (j->colour.r * 255, j->colour.g * 255, j->colour.b * 255), j->font_size.points (72 * 11), 1.0, - dcp::Time (_subtitles[_next].from.all_as_seconds()), - dcp::Time (_subtitles[_next].to.all_as_seconds()), + dcp::Time (_subtitles[_next].from.all_as_seconds(), 1000), + dcp::Time (_subtitles[_next].to.all_as_seconds(), 1000), 0, dcp::HALIGN_CENTER, i->vertical_position.line.get() * (1.5 / 22) + 0.8, @@ -76,8 +76,8 @@ SubRipDecoder::pass () j->text, dcp::NONE, dcp::Colour (255, 255, 255), - 0, - 0 + dcp::Time (0, 1000), + dcp::Time (0, 1000) ) ); } -- cgit v1.2.3