vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Tue Feb 13 
14:04:13 2018 +0100| [954874105214e31dbf9b9e05fbd7c12e9b8dd9ca] | committer: 
Francois Cartegnie

demux: adaptive: remove redir count parameter

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=954874105214e31dbf9b9e05fbd7c12e9b8dd9ca
---

 modules/demux/adaptive/http/Chunk.cpp          | 5 +++--
 modules/demux/adaptive/http/Chunk.h            | 2 +-
 modules/demux/adaptive/http/HTTPConnection.hpp | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/http/Chunk.cpp 
b/modules/demux/adaptive/http/Chunk.cpp
index 5dad106e1a..25b33961e2 100644
--- a/modules/demux/adaptive/http/Chunk.cpp
+++ b/modules/demux/adaptive/http/Chunk.cpp
@@ -204,7 +204,7 @@ block_t * HTTPChunkSource::read(size_t readsize)
     return p_block;
 }
 
-bool HTTPChunkSource::prepare(int i_redir)
+bool HTTPChunkSource::prepare()
 {
     if(prepared)
         return true;
@@ -214,7 +214,8 @@ bool HTTPChunkSource::prepare(int i_redir)
 
     ConnectionParams connparams = params; /* can be changed on 301 */
 
-    while(i_redir++ < 3)
+    int i_redirects = 0;
+    while(i_redirects++ < HTTPConnection::MAX_REDIRECTS)
     {
         if(!connection)
         {
diff --git a/modules/demux/adaptive/http/Chunk.h 
b/modules/demux/adaptive/http/Chunk.h
index fba01cbfbf..a92c20ee6a 100644
--- a/modules/demux/adaptive/http/Chunk.h
+++ b/modules/demux/adaptive/http/Chunk.h
@@ -94,7 +94,7 @@ namespace adaptive
                 static const size_t CHUNK_SIZE = 32768;
 
             protected:
-                virtual bool      prepare(int = 0);
+                virtual bool        prepare();
                 AbstractConnection    *connection;
                 AbstractConnectionManager *connManager;
                 size_t              consumed; /* read pointer */
diff --git a/modules/demux/adaptive/http/HTTPConnection.hpp 
b/modules/demux/adaptive/http/HTTPConnection.hpp
index fcccb22a66..ce19cb166d 100644
--- a/modules/demux/adaptive/http/HTTPConnection.hpp
+++ b/modules/demux/adaptive/http/HTTPConnection.hpp
@@ -74,6 +74,7 @@ namespace adaptive
 
                 void setUsed( bool );
                 const ConnectionParams &getRedirection() const;
+                static const unsigned MAX_REDIRECTS = 3;
 
             protected:
                 virtual bool    connected   () const;

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to