[vlc-commits] [Git][videolan/vlc][master] 3 commits: demux: adaptive: do not recycle unbuffered chunks

François Cartegnie (@fcartegnie) gitlab at videolan.org
Fri Jan 12 09:51:18 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
b33dc7b3 by François Cartegnie at 2024-01-12T09:26:01+00:00
demux: adaptive: do not recycle unbuffered chunks

- - - - -
248dddf5 by François Cartegnie at 2024-01-12T09:26:01+00:00
demux: adaptive: do not recycle chunks without size

- - - - -
d7e6b197 by François Cartegnie at 2024-01-12T09:26:01+00:00
demux: adaptive: set contentLength to buffered size before caching

server might not have set Content-Length, and we need to account
data usage

- - - - -


2 changed files:

- modules/demux/adaptive/http/Chunk.cpp
- modules/demux/adaptive/http/HTTPConnectionManager.cpp


Changes:

=====================================
modules/demux/adaptive/http/Chunk.cpp
=====================================
@@ -255,7 +255,7 @@ block_t * HTTPChunkSource::read(size_t readsize)
 
 void HTTPChunkSource::recycle()
 {
-    connManager->recycleSource(this);
+    delete this;
 }
 
 StorageID HTTPChunkSource::makeStorageID(const std::string &s, const BytesRange &r)
@@ -470,7 +470,8 @@ void HTTPChunkBufferedSource::recycle()
     p_read = p_head;
     inblockreadoffset = 0;
     consumed = 0;
-    HTTPChunkSource::recycle();
+    contentLength = buffered;
+    connManager->recycleSource(this);
 }
 
 block_t * HTTPChunkBufferedSource::readBlock()


=====================================
modules/demux/adaptive/http/HTTPConnectionManager.cpp
=====================================
@@ -217,7 +217,7 @@ void HTTPConnectionManager::recycleSource(AbstractChunkSource *source)
 
     HTTPChunkBufferedSource *buf = dynamic_cast<HTTPChunkBufferedSource *>(source);
     if(buf && b_cacheable && !buf->getStorageID().empty() &&
-       buf->contentLength < cache_max)
+       buf->contentLength && buf->contentLength < cache_max)
     {
         while(cache_max < cache_total + buf->contentLength)
         {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/968680321dcccefb375f3ccf0194c2a43251a2b3...d7e6b197c56d979a69293f09be89996e61458e9a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/968680321dcccefb375f3ccf0194c2a43251a2b3...d7e6b197c56d979a69293f09be89996e61458e9a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list