Missing stop emission for fully-timed FFmpeg subtitles; should fix #1101.
authorCarl Hetherington <cth@carlh.net>
Fri, 5 Jan 2018 21:25:34 +0000 (21:25 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 Jan 2018 21:25:34 +0000 (21:25 +0000)
ChangeLog
src/lib/ffmpeg_decoder.cc

index 05d29803adfce4667b1fa6fd9c146d468e81d849..0d7177c6552cad5f86cb2514b5631abbd5b00490 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2018-01-05  Carl Hetherington  <cth@carlh.net>
 
+       * Fix hanging subtitles in some cases (#1101).
+
        * Version 2.11.36 released.
 
 2018-01-04  Carl Hetherington  <cth@carlh.net>
index 0d6ac383f903c389b3bf1b999590107722210036..26b1d4bf8081b7dc1e536c2b0473c919721f9398 100644 (file)
@@ -563,6 +563,8 @@ FFmpegDecoder::decode_subtitle_packet ()
        _have_current_subtitle = true;
        if (sub_period.to) {
                _current_subtitle_to = *sub_period.to + _pts_offset;
+       } else {
+               _current_subtitle_to = optional<ContentTime>();
        }
 
        for (unsigned int i = 0; i < sub.num_rects; ++i) {
@@ -583,6 +585,10 @@ FFmpegDecoder::decode_subtitle_packet ()
                }
        }
 
+       if (_current_subtitle_to) {
+               subtitle->emit_stop (*_current_subtitle_to);
+       }
+
        avsubtitle_free (&sub);
 }