changeset 3600:68e5f9adb0f4 libavformat

Detect IDR less H.264 correctly. Fixes maybeH264_dumpvideo
author michael
date Sat, 26 Jul 2008 18:54:26 +0000
parents d99961d92b99
children c0955bfc27be
files raw.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/raw.c	Sat Jul 26 07:09:44 2008 +0000
+++ b/raw.c	Sat Jul 26 18:54:26 2008 +0000
@@ -350,7 +350,7 @@
 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 @@
                 res++;
 
             switch(type){
+            case     1:   sli++; break;
             case     5:   idr++; break;
             case     7:
                 if(p->buf[i+2]&0x0F)
@@ -386,7 +387,7 @@
             }
         }
     }
-    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;
 }