# HG changeset patch # User mmu_man # Date 1106808789 0 # Node ID 0624def73c76b6aefeb7445c3d39398328bb5a49 # Parent 5b9575f5b6e804ec3fadf404c854f604290cda77 probe for 'junk' and 'pict', changed the scores. diff -r 5b9575f5b6e8 -r 0624def73c76 mov.c --- a/mov.c Wed Jan 26 09:31:49 2005 +0000 +++ b/mov.c Thu Jan 27 06:53:09 2005 +0000 @@ -1616,6 +1616,7 @@ { unsigned int offset; uint32_t tag; + int score = 0; /* check file header */ if (p->buf_size <= 12) @@ -1624,26 +1625,33 @@ 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)