Fix vc1 split().
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2009 20:48:12 +0000 (20:48 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2009 20:48:12 +0000 (20:48 +0000)
Fixes Subtitle-sample.evo, issue52.

Originally committed as revision 17533 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/vc1_parser.c

index a9baccc..3f4618d 100644 (file)
@@ -99,11 +99,17 @@ static int vc1_split(AVCodecContext *avctx,
 {
     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;
 }