[vlc-commits] demux: adaptative: compute contentlength from	byterange
    Francois Cartegnie 
    git at videolan.org
       
    Wed Dec  2 15:27:54 CET 2015
    
    
  
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec  1 22:29:50 2015 +0100| [19375695812ca47c8eedf2c28b92e8942256f1dd] | committer: Francois Cartegnie
demux: adaptative: compute contentlength from byterange
If byterange request is done and reply does not provide
content-length reply, read will block due to keepalive.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19375695812ca47c8eedf2c28b92e8942256f1dd
---
 modules/demux/adaptative/http/HTTPConnection.cpp |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/modules/demux/adaptative/http/HTTPConnection.cpp b/modules/demux/adaptative/http/HTTPConnection.cpp
index d9d9bbf..625ae2c 100644
--- a/modules/demux/adaptative/http/HTTPConnection.cpp
+++ b/modules/demux/adaptative/http/HTTPConnection.cpp
@@ -89,6 +89,8 @@ int HTTPConnection::query(const std::string &path, const BytesRange &range)
         return VLC_EGENERIC;
 
     bytesRange = range;
+    if(range.isValid() && range.getEndByte() > 0)
+        contentLength = range.getEndByte() - range.getStartByte() + 1;
 
     std::string header = buildRequestHeader(path);
     if(connectionClose)
    
    
More information about the vlc-commits
mailing list