Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
5045:f0e079daad30 | 5046:da1ca444ff51 |
---|---|
36 state= pc->state; | 36 state= pc->state; |
37 | 37 |
38 for(i=0; i<buf_size && !vop_found; i++){ | 38 for(i=0; i<buf_size && !vop_found; i++){ |
39 state= (state<<8) | buf[i]; | 39 state= (state<<8) | buf[i]; |
40 for(j=0; j<8; j++){ | 40 for(j=0; j<8; j++){ |
41 if(((state>>j)&0xFFFFF) == 0x00010){ | 41 if(((state>>j)&0xFFFFF0) == 0x000100){ |
42 vop_found=1; | 42 vop_found=1; |
43 break; | 43 break; |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 if(vop_found){ | 47 if(vop_found){ |
48 for(; i<buf_size; i++){ | 48 for(; i<buf_size; i++){ |
49 state= (state<<8) | buf[i]; | 49 state= (state<<8) | buf[i]; |
50 for(j=0; j<8; j++){ | 50 for(j=0; j<8; j++){ |
51 if(((state>>j)&0xFFFFF) == 0x00010){ | 51 if(((state>>j)&0xFFFFF0) == 0x000100){ |
52 pc->frame_start_found=0; | 52 pc->frame_start_found=0; |
53 pc->state= state>>(2*8); | 53 pc->state= (state>>(3*8))+0xFF00; |
54 return i-1; | 54 return i-2; |
55 } | 55 } |
56 } | 56 } |
57 } | 57 } |
58 } | 58 } |
59 | 59 |