changeset 9009:9a642761d734 libavcodec

Fix vc1 split(). Fixes Subtitle-sample.evo, issue52.
author michael
date Sun, 22 Feb 2009 20:48:12 +0000
parents 251c7a9cb795
children b6a47d0b6b63
files vc1_parser.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vc1_parser.c	Sun Feb 22 18:13:40 2009 +0000
+++ b/vc1_parser.c	Sun Feb 22 20:48:12 2009 +0000
@@ -99,11 +99,17 @@
 {
     int i;
     uint32_t state= -1;
+    int charged=0;
 
     for(i=0; i<buf_size; i++){
         state= (state<<8) | buf[i];
-        if(IS_MARKER(state) && state != VC1_CODE_SEQHDR && state != VC1_CODE_ENTRYPOINT)
-            return i-3;
+        if(IS_MARKER(state)){
+            if(state == VC1_CODE_SEQHDR || state == VC1_CODE_ENTRYPOINT){
+                charged=1;
+            }else if(charged){
+                return i-3;
+            }
+        }
     }
     return 0;
 }