mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-01 13:36:26 +08:00
simplify
Originally committed as revision 4940 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -237,20 +237,18 @@ const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end
|
|||||||
if(tmp == 0x100 || p==end)
|
if(tmp == 0x100 || p==end)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
p--; // need to recheck or might miss one
|
|
||||||
end--; // we need the byte after 00 00 01 too
|
|
||||||
|
|
||||||
while(p<end){
|
while(p<end){
|
||||||
if (p[ 0] > 1) p+= 3;
|
if (p[-1] > 1 ) p+= 3;
|
||||||
else if(p[-1] ) p+= 2;
|
else if(p[-2] ) p+= 2;
|
||||||
else if(p[-2]|(p[0]-1)) p++;
|
else if(p[-3]|(p[-1]-1)) p++;
|
||||||
else{
|
else{
|
||||||
p++;
|
p++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p= FFMIN(p, end)-3;
|
p= FFMIN(p, end)-4;
|
||||||
*state= be2me_32(unaligned32(p));
|
*state= be2me_32(unaligned32(p));
|
||||||
|
|
||||||
return p+4;
|
return p+4;
|
||||||
|
Reference in New Issue
Block a user