From 1bb8a53f080e8bec821f9cf86a5ee524a58a927a Mon Sep 17 00:00:00 2001 From: Yayoi Date: Sun, 30 Aug 2015 07:24:49 -0700 Subject: [PATCH] avformat/samidec: do not include trailing sami footer in the last packet MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Bœsch --- libavformat/samidec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/samidec.c b/libavformat/samidec.c index 948e1ed8b13..bc9b745e9ce 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, "