[FFmpeg-devel] [PATCH 1/2] avformat/aviobuf: Use a 512kb IO buffer for http* instead of 32kb

Michael Niedermayer michaelni at gmx.at
Thu Mar 27 00:24:24 CET 2014


This makes it possible to avoid some excessive seeking
although the next commit is needed too

The special case for http could be replaced by using the network
flag but that would require testing each protocol.
Its easier to add protocols one at a time when they are tested
and at the end replace the list by using the network flag

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/aviobuf.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index be4dd7a..622f22c 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -737,6 +737,8 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
     } else {
         buffer_size = IO_BUFFER_SIZE;
     }
+    if (h->prot && !strncmp(h->prot->name, "http", 4))
+        buffer_size = FFMAX(buffer_size, 1<<19);
     buffer = av_malloc(buffer_size);
     if (!buffer)
         return AVERROR(ENOMEM);
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list