From 57eb217ac45e4976dc40c23646eb95ad143970d8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 18 Jun 2010 23:17:20 +0000 Subject: [PATCH] Improve h263_probe() Fixes issue2015 Originally committed as revision 23645 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/raw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavformat/raw.c b/libavformat/raw.c index 0a188cf25c..0c83c429ba 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -457,6 +457,7 @@ static int h263_probe(AVProbeData *p) int invalid_psc=0; int res_change=0; int src_fmt, last_src_fmt=-1; + int last_gn=0; for(i=0; ibuf_size; i++){ code = (code<<8) + p->buf[i]; @@ -469,9 +470,16 @@ static int h263_probe(AVProbeData *p) if((code&0x300)==0x200 && src_fmt){ valid_psc++; + last_gn=0; }else invalid_psc++; last_src_fmt= src_fmt; + } else if((code & 0xffff800000) == 0x800000) { + int gn= (code>>(23-5)) & 0x1F; + if(gn