]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/samidec.c
libavformat/riff.c: Add support for RV40 codec in AVI
[ffmpeg] / libavformat / samidec.c
index 948e1ed8b1316907444187b2b7c9d921c95caed9..11c674ce19b28ac57afaca4c32750f312d141b56 100644 (file)
@@ -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;
@@ -99,7 +105,7 @@ static int sami_read_header(AVFormatContext *s)
     if (res < 0)
         goto end;
 
-    ff_subtitles_queue_finalize(&sami->q);
+    ff_subtitles_queue_finalize(s, &sami->q);
 
 end:
     av_bprint_finalize(&buf, NULL);