[FFmpeg-cvslog] avformat/sccdec: display last caption even when there is no empty last line

Paul B Mahol git at videolan.org
Thu Jun 27 21:22:05 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jun 27 20:20:16 2019 +0200| [2b15d436db3ff13c9f87b1396cbe6dad54a50860] | committer: Paul B Mahol

avformat/sccdec: display last caption even when there is no empty last line

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b15d436db3ff13c9f87b1396cbe6dad54a50860
---

 libavformat/sccdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
index 006300fbcc..412d8aaf49 100644
--- a/libavformat/sccdec.c
+++ b/libavformat/sccdec.c
@@ -110,6 +110,7 @@ static int scc_read_header(AVFormatContext *s)
         ts_end = (hh2 * 3600LL + mm2 * 60LL + ss2) * 1000LL + fs2 * 33;
         count++;
 
+try_again:
         lline = (char *)&line;
         lline += 12;
 
@@ -138,9 +139,13 @@ static int scc_read_header(AVFormatContext *s)
         sub->pts = ts_start;
         sub->duration = FFMAX(1200, ts_end - ts_start);
         memmove(line, line2, sizeof(line));
+        line2[0] = 0;
         FFSWAP(ptrdiff_t, len, len2);
     }
 
+    if (line[0])
+        goto try_again;
+
     ff_subtitles_queue_finalize(s, &scc->q);
 
     return ret;



More information about the ffmpeg-cvslog mailing list