1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

fix avc nal parsing

Originally committed as revision 5382 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2006-05-15 17:11:50 +00:00
parent a959f0ea7a
commit 2c95f59f06

View File

@ -452,15 +452,15 @@ static uint8_t *avc_find_startcode( uint8_t *p, uint8_t *end )
if( (x - 0x01010101) & (~x) & 0x80808080 ) { // generic if( (x - 0x01010101) & (~x) & 0x80808080 ) { // generic
if( p[1] == 0 ) { if( p[1] == 0 ) {
if( p[0] == 0 && p[2] == 1 ) if( p[0] == 0 && p[2] == 1 )
return p; return p-1;
if( p[2] == 0 && p[3] == 1 ) if( p[2] == 0 && p[3] == 1 )
return p+1; return p;
} }
if( p[3] == 0 ) { if( p[3] == 0 ) {
if( p[2] == 0 && p[4] == 1 ) if( p[2] == 0 && p[4] == 1 )
return p+2; return p+1;
if( p[4] == 0 && p[5] == 1 ) if( p[4] == 0 && p[5] == 1 )
return p+3; return p+2;
} }
} }
} }