Mercurial > libavformat.hg
changeset 6144:f2c92e715300 libavformat
Improve h263_probe()
Fixes issue2015
author | michael |
---|---|
date | Fri, 18 Jun 2010 23:17:20 +0000 |
parents | 66b74fc6eeb9 |
children | 33fe8833a439 |
files | raw.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/raw.c Fri Jun 18 17:54:56 2010 +0000 +++ b/raw.c Fri Jun 18 23:17:20 2010 +0000 @@ -457,6 +457,7 @@ int invalid_psc=0; int res_change=0; int src_fmt, last_src_fmt=-1; + int last_gn=0; for(i=0; i<p->buf_size; i++){ code = (code<<8) + p->buf[i]; @@ -469,9 +470,16 @@ 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<last_gn){ + invalid_psc++; + }else + last_gn= gn; } } //av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", valid_psc, invalid_psc, res_change);