[FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: set AVIO_SEEKABLE_SLOW for network based protocols

Michael Niedermayer michaelni at gmx.at
Wed Mar 26 17:59:01 CET 2014


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

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 95fdf20..911271b 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -747,7 +747,10 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
         return AVERROR(ENOMEM);
     }
     (*s)->direct = h->flags & AVIO_FLAG_DIRECT;
-    (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL;
+    if (h->prot && h->prot->flags & URL_PROTOCOL_FLAG_NETWORK) {
+        (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_SLOW;
+    } else
+        (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL;
     (*s)->max_packet_size = max_packet_size;
     if(h->prot) {
         (*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list