[SCM] libav/experimental: probe for 'junk' and 'pict', changed the scores.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:42:52 UTC 2013


The following commit has been merged in the experimental branch:
commit 2497479f2b9647dadf3a60a875c819fa1b5075ff
Author: François Revol <revol at free.fr>
Date:   Thu Jan 27 06:53:09 2005 +0000

    probe for 'junk' and 'pict', changed the scores.
    
    Originally committed as revision 3888 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0d2ddce..8c33411 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1616,6 +1616,7 @@ static int mov_probe(AVProbeData *p)
 {
     unsigned int offset;
     uint32_t tag;
+    int score = 0;
 
     /* check file header */
     if (p->buf_size <= 12)
@@ -1624,26 +1625,33 @@ static int mov_probe(AVProbeData *p)
     for(;;) {
         /* ignore invalid offset */
         if ((offset + 8) > (unsigned int)p->buf_size)
-            return 0;
+            return score;
         tag = mov_to_tag(p->buf + offset + 4);
         switch(tag) {
+        /* check for obvious tags */
         case MKTAG( 'm', 'o', 'o', 'v' ):
-        case MKTAG( 'w', 'i', 'd', 'e' ):
-        case MKTAG( 'f', 'r', 'e', 'e' ):
         case MKTAG( 'm', 'd', 'a', 't' ):
         case MKTAG( 'p', 'n', 'o', 't' ): /* detect movs with preview pics like ew.mov and april.mov */
         case MKTAG( 'u', 'd', 't', 'a' ): /* Packet Video PVAuthor adds this and a lot of more junk */
             return AVPROBE_SCORE_MAX;
+        /* those are more common words, so rate then a bit less */
+        case MKTAG( 'w', 'i', 'd', 'e' ):
+        case MKTAG( 'f', 'r', 'e', 'e' ):
+        case MKTAG( 'j', 'u', 'n', 'k' ):
+        case MKTAG( 'p', 'i', 'c', 't' ):
+            return AVPROBE_SCORE_MAX - 5;
         case MKTAG( 'f', 't', 'y', 'p' ):
         case MKTAG( 's', 'k', 'i', 'p' ):
             offset = to_be32(p->buf+offset) + offset;
+            /* if we only find those cause probedata is too small at least rate them */
+            score = AVPROBE_SCORE_MAX - 50;
             break;
         default:
             /* unrecognized tag */
-            return 0;
+            return score;
         }
     }
-    return 0;
+    return score;
 }
 
 static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list