Commit 67972f97 authored by Zhao Zhili's avatar Zhao Zhili Committed by François Cartegnie

adaptive: avoid a division by 0

It depends on the clock resolution.
Signed-off-by: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
(cherry picked from commit da1a7067)
parent 80819755
......@@ -197,7 +197,8 @@ block_t * HTTPChunkSource::read(size_t readsize)
consumed += p_block->i_buffer;
if((size_t)ret < readsize)
eof = true;
connManager->updateDownloadRate(sourceid, p_block->i_buffer, time);
if(ret && time)
connManager->updateDownloadRate(sourceid, p_block->i_buffer, time);
}
return p_block;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment