[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: demux: adaptive: do not recycle unbuffered chunks
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Fri Mar 27 09:39:35 UTC 2026
Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC
Commits:
33c0023c by François Cartegnie at 2026-03-27T09:29:24+01:00
demux: adaptive: do not recycle unbuffered chunks
(cherry picked from commit b33dc7b3c40b59bc6d93e5757f4c5c179bc46596)
- - - - -
4b8cd3bd by François Cartegnie at 2026-03-27T09:29:24+01:00
demux: adaptive: do not recycle chunks without size
(cherry picked from commit 248dddf509c919b58975ccdb2a428ba90590a39c)
- - - - -
b8e93569 by François Cartegnie at 2026-03-27T09:29:24+01:00
demux: adaptive: set contentLength to buffered size before caching
server might not have set Content-Length, and we need to account
data usage
(cherry picked from commit d7e6b197c56d979a69293f09be89996e61458e9a)
- - - - -
2 changed files:
- modules/demux/adaptive/http/Chunk.cpp
- modules/demux/adaptive/http/HTTPConnectionManager.cpp
Changes:
=====================================
modules/demux/adaptive/http/Chunk.cpp
=====================================
@@ -258,7 +258,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)
@@ -478,7 +478,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
=====================================
@@ -209,7 +209,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/8be8af56aa22748943304403c57c0e1547fb4b9c...b8e93569018f4c92e8c72436d3f7ebd3d2b2d02b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8be8af56aa22748943304403c57c0e1547fb4b9c...b8e93569018f4c92e8c72436d3f7ebd3d2b2d02b
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list