Fix overlapping burnt-in subtitles in some cases (#959).
authorCarl Hetherington <cth@carlh.net>
Fri, 7 Oct 2016 23:45:22 +0000 (00:45 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 7 Oct 2016 23:45:22 +0000 (00:45 +0100)
commit37494990bbe81f41f581de8258dc7353b82d662d
tree01fd28caeff323c9ffed0bf9b04ecee358b316d0
parentb0463c6c22d51f6297eea313b429348c3bec3971
Fix overlapping burnt-in subtitles in some cases (#959).

Firstly, when finding subtitles that exist during a period, only
return those which overlap more than half the period.  This means
that, in a fight over a frame, the longest-running subtitle in that
frame will win.

Secondly, make SubtitleDecoder::get pick the wanted subtitles from
the cache simply by comparing their periods to those that were
requested.  I think this is nicer than what was there before
(basically reevaulating 'what subtitle(s) for this period') and
also makes the first part of this commit effective.
ChangeLog
src/lib/dcpomatic_time.h
src/lib/subtitle_decoder.cc
src/lib/subtitle_decoder.h
src/lib/text_subtitle_decoder.cc