diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-02-04 22:18:45 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-02-04 22:18:45 +0000 |
commit | 809b2a30b2c0ace6e9f9d00d6a5437b68eab5deb (patch) | |
tree | 48cfaf40b1ca80f4d2e849f144c9247526a235f6 /libavcodec | |
parent | 82fcbc145dde97c92ed7f951c9103c49a71b2b90 (diff) | |
download | ffmpeg-809b2a30b2c0ace6e9f9d00d6a5437b68eab5deb.tar.gz |
simplify
Originally committed as revision 4940 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 8e2799bcad..a4e56dc23f 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -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) return p; } - p--; // need to recheck or might miss one - end--; // we need the byte after 00 00 01 too while(p<end){ - if (p[ 0] > 1) p+= 3; - else if(p[-1] ) p+= 2; - else if(p[-2]|(p[0]-1)) p++; + if (p[-1] > 1 ) p+= 3; + else if(p[-2] ) p+= 2; + else if(p[-3]|(p[-1]-1)) p++; else{ p++; break; } } - p= FFMIN(p, end)-3; + p= FFMIN(p, end)-4; *state= be2me_32(unaligned32(p)); return p+4; |