[vlc-commits] stream_filter: dash: fix endless loop on thread early cancellation

Francois Cartegnie git at videolan.org
Thu Dec 18 22:39:46 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 19 13:49:38 2014 +0100| [14f9d9d4864e7549c33f98546116baf43942016b] | committer: Francois Cartegnie

stream_filter: dash: fix endless loop on thread early cancellation

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

 modules/stream_filter/dash/http/HTTPConnection.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/stream_filter/dash/http/HTTPConnection.cpp b/modules/stream_filter/dash/http/HTTPConnection.cpp
index 847ccf6..98baa1b 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnection.cpp
@@ -47,7 +47,7 @@ int             HTTPConnection::read            (void *p_buffer, size_t len)
 {
     if(this->peekBufferLen == 0)
     {
-        int size = net_Read(this->stream, this->httpSocket, NULL, p_buffer, len, false);
+        ssize_t size = net_Read(stream, httpSocket, NULL, p_buffer, len, false);
 
         if(size <= 0)
             return 0;
@@ -135,15 +135,15 @@ std::string     HTTPConnection::readLine        ()
 {
     std::stringstream ss;
     char c[1];
-    size_t size = net_Read(this->stream, this->httpSocket, NULL, c, 1, false);
+    ssize_t size = net_Read(stream, httpSocket, NULL, c, 1, false);
 
-    while(size)
+    while(size >= 0)
     {
         ss << c[0];
         if(c[0] == '\n')
             break;
 
-        size = net_Read(this->stream, this->httpSocket, NULL, c, 1, false);
+        size = net_Read(stream, httpSocket, NULL, c, 1, false);
     }
 
     if(size > 0)



More information about the vlc-commits mailing list