Add another believed-correct subtitle timing fix. v2.15.161
authorCarl Hetherington <cth@carlh.net>
Sun, 12 Sep 2021 20:51:09 +0000 (22:51 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 12 Sep 2021 23:22:00 +0000 (01:22 +0200)
src/lib/ffmpeg.cc

index 31aa182937d24512d3f48c543bf7d4329f4dcc20..503f8e51cf13b146d25d81d443688428a87e5f97 100644 (file)
@@ -288,7 +288,7 @@ FFmpeg::subtitle_period (AVPacket const* packet, AVStream const* stream, AVSubti
 {
        auto const packet_time = ContentTime::from_seconds (packet->pts * av_q2d(stream->time_base));
 
 {
        auto const packet_time = ContentTime::from_seconds (packet->pts * av_q2d(stream->time_base));
 
-       if (sub.end_display_time == static_cast<uint32_t> (-1)) {
+       if (sub.end_display_time == 0 || sub.end_display_time == static_cast<uint32_t>(-1)) {
                /* End time is not known */
                return FFmpegSubtitlePeriod (packet_time + ContentTime::from_seconds (sub.start_display_time / 1e3));
        }
                /* End time is not known */
                return FFmpegSubtitlePeriod (packet_time + ContentTime::from_seconds (sub.start_display_time / 1e3));
        }