summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-12 20:42:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-12 20:45:36 +0200
commitb3b505c73bf515a4b6274b847eeac48b51b4fd5a (patch)
tree859e638a4a4b3a0e55fa6a0e65e425f927cfae5b
parentd05588e21e4744ae6a47192dc2da2844d6934a5d (diff)
avformat/utils: if the id3 tag is too large for data after it to become available, use the full AVPROBE_SCORE_EXTENSION if extension matches
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ce5dbdfe0c..d84d6053ff 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -264,8 +264,11 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened,
score = 0;
if (fmt1->read_probe) {
score = fmt1->read_probe(&lpd);
- if (fmt1->extensions && av_match_ext(lpd.filename, fmt1->extensions))
- score = FFMAX(score, nodat ? AVPROBE_SCORE_EXTENSION / 2 - 1 : 1);
+ if (fmt1->extensions && av_match_ext(lpd.filename, fmt1->extensions)) {
+ if (nodat == 0) score = FFMAX(score, 1);
+ else if (nodat == 1) score = FFMAX(score, AVPROBE_SCORE_EXTENSION / 2 - 1);
+ else score = FFMAX(score, AVPROBE_SCORE_EXTENSION);
+ }
} else if (fmt1->extensions) {
if (av_match_ext(lpd.filename, fmt1->extensions))
score = AVPROBE_SCORE_EXTENSION;