diff h261_parser.c @ 5046:da1ca444ff51 libavcodec

slightly more correct spliting of frames
author michael
date Sun, 20 May 2007 01:05:34 +0000
parents 0d1cc37d9430
children e9d9d946f213
line wrap: on
line diff
--- a/h261_parser.c	Sat May 19 15:06:34 2007 +0000
+++ b/h261_parser.c	Sun May 20 01:05:34 2007 +0000
@@ -38,7 +38,7 @@
     for(i=0; i<buf_size && !vop_found; i++){
         state= (state<<8) | buf[i];
         for(j=0; j<8; j++){
-            if(((state>>j)&0xFFFFF) == 0x00010){
+            if(((state>>j)&0xFFFFF0) == 0x000100){
                 vop_found=1;
                 break;
             }
@@ -48,10 +48,10 @@
         for(; i<buf_size; i++){
             state= (state<<8) | buf[i];
             for(j=0; j<8; j++){
-                if(((state>>j)&0xFFFFF) == 0x00010){
+                if(((state>>j)&0xFFFFF0) == 0x000100){
                     pc->frame_start_found=0;
-                    pc->state= state>>(2*8);
-                    return i-1;
+                    pc->state= (state>>(3*8))+0xFF00;
+                    return i-2;
                 }
             }
         }