From 4d986d2a9871c77f3dab21acd38e070378a48f42 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 Jan 2014 23:01:00 +0100 Subject: demux_lavf: add hack to workaround too unreliable mp3 detection This generally affects mp3 files that don't have any (or many) mp3 frames in the first 2 MB. 2 MB is the maximum probe size, and libavformat returns a low probescore even if we give it the full 2 MB. Trying to probe a larger buffer (or even the full file) doesn't work for mysterious reasons. The workaround consists in accepting a very weak probescore if the format is detected as mp3 and we probed already 2 MB. --- demux/demux_lavf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index df899c7edc..8147c21ffd 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -98,6 +98,8 @@ static const struct format_hack format_hacks[] = { {"aac", "audio/aacp", 25, 0.5}, {"aac", "audio/aac", 25, 0.5}, {"mp3", "audio/mpeg", 25, 0.5}, + // some mp3 files don't detect correctly + {"mp3", NULL, 24, .max_probe = true}, {0} }; -- cgit v1.2.3