diff options
author | Peter Zebühr <[email protected]> | 2023-11-21 14:16:49 +0100 |
---|---|---|
committer | Tomas Härdin <[email protected]> | 2025-02-26 14:52:34 +0100 |
commit | e24920375cd2bbdd579424c16cf0f9c66579ea24 (patch) | |
tree | c8def3382fb3cc281de59ca59ff7ce58744ba423 /libavformat/libopenmpt.c | |
parent | 5a526fdad01054d611be715099432bc7ac94a14b (diff) |
Make mime-type award a bonus probe score
This changes the default behaviour of ffmpeg where content-type headers
on an input gives an absolut probe score (of 75) to instead give a bonus
score (of 30). This gives the probe a better chance to arrive at the
correct format by (hopefully) giving a large enough bonus to push edge
cases in the right direction (MPEG-PS vs MP3, I am looking at you) while
also not adversly punishing clearer cases (raw ADTS marked as
"audio/mpeg" for example).
This patch was regression tested against 20 million recent podcast
submissions (after content-type propagation was added to
original-storage), and 50k Juno vodcasts submissions (dito). No adverse
effects observed (but the bonus may still need tweaking if other edge
cases are detected in production).
Diffstat (limited to 'libavformat/libopenmpt.c')
-rw-r--r-- | libavformat/libopenmpt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c index 736af7caf2..dee975c9c2 100644 --- a/libavformat/libopenmpt.c +++ b/libavformat/libopenmpt.c @@ -244,7 +244,7 @@ static int read_probe_openmpt(const AVProbeData *p) * AVPROBE_SCORE_MAX in order to reduce the impact in the rare * cases of false positives. */ - return AVPROBE_SCORE_MIME + 1; + return (AVPROBE_SCORE_MAX * 3) / 4 + 1; } else if (probe_result == OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA) { if (probe_openmpt_extension(p) > 0) { return AVPROBE_SCORE_RETRY; |