diff options
author | Yayoi | 2015-08-30 07:24:49 -0700 |
---|---|---|
committer | Clément Bœsch | 2015-09-06 13:09:02 +0200 |
commit | 1bb8a53f080e8bec821f9cf86a5ee524a58a927a (patch) | |
tree | 6e30e4d5c966c631b862e4df27760f592aa63638 | |
parent | fc9aa1fb4694f03eb84c630c9367d49afb766a72 (diff) |
avformat/samidec: do not include trailing sami footer in the last packet
Signed-off-by: Clément Bœsch <u@pkh.me>
-rw-r--r-- | libavformat/samidec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/samidec.c b/libavformat/samidec.c index 948e1ed8b1..bc9b745e9c 100644 --- a/libavformat/samidec.c +++ b/libavformat/samidec.c @@ -68,11 +68,17 @@ static int sami_read_header(AVFormatContext *s) while (!ff_text_eof(&tr)) { AVPacket *sub; const int64_t pos = ff_text_pos(&tr) - (c != 0); - int is_sync, n = ff_smil_extract_next_text_chunk(&tr, &buf, &c); + int is_sync, is_body, n = ff_smil_extract_next_text_chunk(&tr, &buf, &c); if (n == 0) break; + is_body = !av_strncasecmp(buf.str, "</BODY", 6); + if (is_body) { + av_bprint_clear(&buf); + break; + } + is_sync = !av_strncasecmp(buf.str, "<SYNC", 5); if (is_sync) got_first_sync_point = 1; |