summaryrefslogtreecommitdiff
path: root/libavformat/sccdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-12-23 22:15:23 +0100
committerPaul B Mahol <onemda@gmail.com>2019-12-23 22:16:25 +0100
commit9da7536ce25e0f8e1d882d1ff83d7dbf66187b9a (patch)
tree297b2173012cd25942c1868c01dce25397dffb98 /libavformat/sccdec.c
parent547b0c61af17c74fc906d0630c82a4c8ec94147e (diff)
avformat/sccdec: fix timestamp of last subtitle
Fixes -c:s copy case.
Diffstat (limited to 'libavformat/sccdec.c')
-rw-r--r--libavformat/sccdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
index 399be76668..37570e0fb0 100644
--- a/libavformat/sccdec.c
+++ b/libavformat/sccdec.c
@@ -63,6 +63,7 @@ static int scc_read_header(AVFormatContext *s)
SCCContext *scc = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
char line[4096], line2[4096];
+ int64_t ts_start, ts_end;
int count = 0, ret = 0;
ptrdiff_t len2, len;
uint8_t out[4096];
@@ -81,7 +82,6 @@ static int scc_read_header(AVFormatContext *s)
char *saveptr = NULL, *lline;
int hh1, mm1, ss1, fs1, i;
int hh2, mm2, ss2, fs2;
- int64_t ts_start, ts_end;
AVPacket *sub;
if (count == 0) {
@@ -142,8 +142,10 @@ try_again:
line2[0] = 0;
}
- if (line[0])
+ if (line[0]) {
+ ts_start = ts_end;
goto try_again;
+ }
ff_subtitles_queue_finalize(s, &scc->q);