diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-26 18:54:26 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-26 18:54:26 +0000 |
commit | 01037451f932570efddaa935fc348a386373f57a (patch) | |
tree | a3270790fffcedd4f6623a1102e28b48df22b13a | |
parent | e791eb1ed4444f6befbd728072dffd3043ca5fb6 (diff) | |
download | ffmpeg-01037451f932570efddaa935fc348a386373f57a.tar.gz |
Detect IDR less H.264 correctly.
Fixes maybeH264_dumpvideo
Originally committed as revision 14424 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/raw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index dd4d0115df..bb1345a043 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -350,7 +350,7 @@ static int mpeg4video_probe(AVProbeData *probe_packet) static int h264_probe(AVProbeData *p) { uint32_t code= -1; - int sps=0, pps=0, idr=0, res=0; + int sps=0, pps=0, idr=0, res=0, sli=0; int i; for(i=0; i<p->buf_size; i++){ @@ -376,6 +376,7 @@ static int h264_probe(AVProbeData *p) res++; switch(type){ + case 1: sli++; break; case 5: idr++; break; case 7: if(p->buf[i+2]&0x0F) @@ -386,7 +387,7 @@ static int h264_probe(AVProbeData *p) } } } - if(sps && pps && idr && res<(sps+pps+idr)) + if(sps && pps && (idr||sli>3) && res<(sps+pps+idr)) return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg return 0; } |