Commit 2b15d436 authored by Paul B Mahol's avatar Paul B Mahol

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

parent 025fcee6
...@@ -110,6 +110,7 @@ static int scc_read_header(AVFormatContext *s) ...@@ -110,6 +110,7 @@ static int scc_read_header(AVFormatContext *s)
ts_end = (hh2 * 3600LL + mm2 * 60LL + ss2) * 1000LL + fs2 * 33; ts_end = (hh2 * 3600LL + mm2 * 60LL + ss2) * 1000LL + fs2 * 33;
count++; count++;
try_again:
lline = (char *)&line; lline = (char *)&line;
lline += 12; lline += 12;
...@@ -138,9 +139,13 @@ static int scc_read_header(AVFormatContext *s) ...@@ -138,9 +139,13 @@ static int scc_read_header(AVFormatContext *s)
sub->pts = ts_start; sub->pts = ts_start;
sub->duration = FFMAX(1200, ts_end - ts_start); sub->duration = FFMAX(1200, ts_end - ts_start);
memmove(line, line2, sizeof(line)); memmove(line, line2, sizeof(line));
line2[0] = 0;
FFSWAP(ptrdiff_t, len, len2); FFSWAP(ptrdiff_t, len, len2);
} }
if (line[0])
goto try_again;
ff_subtitles_queue_finalize(s, &scc->q); ff_subtitles_queue_finalize(s, &scc->q);
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment