From 8cfb87d200b9029d9318d1c6ce76e489e78c2121 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 27 May 2013 23:26:22 +0200 Subject: demux_lavf: minimal probing and reduced analyzeduration for AAC over HTTP When AAC is streamed over HTTP, using libavformat defaults is pathetically slow. One solution for that is skipping probing and using the mimetype to identify that it's AAC instead. This is what we did before this commit (and ffmpeg does it too, but their logic is too "inaccessible" for mpv). This is still pretty fragile though. Make it a bit more robust by requiring minimal probing. A probescore of 25 is reached after feeding 2 KB to libavformat (instead of > 500 KB for the normal probescore), so use that. This is done only when streaming AAC from HTTP to reduce the possibility of weird breakages for other formats. Also reduce analyzeduration. The default analyzeduration will make libavformat read lots of data, which makes playback start slow. So we set analyzeduration to a low value. On the other hand, doing that for other formats is risky, because there are unspecified effects with certain "strange" formats (like transport streams). So we do this only if we're streaming AAC from HTTP as well. tl;dr libavformat is shit for media players --- core/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/options.h b/core/options.h index b2e38ec56d..25aa82791a 100644 --- a/core/options.h +++ b/core/options.h @@ -222,7 +222,7 @@ typedef struct MPOpts { struct lavfdopts { int probesize; int probescore; - int analyzeduration; + float analyzeduration; int allow_mimetype; char *format; char *cryptokey; -- cgit v1.2.3