summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-11-20 22:08:11 +0000
committerCarl Hetherington <cth@carlh.net>2016-11-20 22:08:11 +0000
commit4337694dfd488e88f56b63898ad35ce8ce9bb3c3 (patch)
tree8bba36173e1781eb18a81081e1ae27de4d4962ff /src/lib/ffmpeg_decoder.cc
parent31724651675fc01a33ffa0818d4397858493dd56 (diff)
Fix subtitles (seen in DVB) which have a specified `to' time but
then are terminated earlier than that by a num_rects=0 subtitle.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index ddc563b98..b7dced34d 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -510,13 +510,11 @@ FFmpegDecoder::decode_subtitle_packet ()
ContentTimePeriod period;
period.from = sub_period.from + _pts_offset;
subtitle->set_position (period.from);
- if (sub_period.to) {
- /* We already know the subtitle period `to' time */
- period.to = sub_period.to.get() + _pts_offset;
- } else {
- /* We have to look up the `to' time in the stream's records */
- period.to = ffmpeg_content()->subtitle_stream()->find_subtitle_to (subtitle_id (sub));
- }
+ /* We can't trust the `to' time from sub_period as there are some decoders which
+ give a sub_period time for `to' which is subsequently overridden by a `stop' subtitle;
+ see also FFmpegExaminer.
+ */
+ period.to = ffmpeg_content()->subtitle_stream()->find_subtitle_to (subtitle_id (sub));
for (unsigned int i = 0; i < sub.num_rects; ++i) {
AVSubtitleRect const * rect = sub.rects[i];