Commit 28bf6140 authored by Zhao Zhili's avatar Zhao Zhili Committed by Jean-Baptiste Kempf

demux: adaptive: fix deadline maths

All variables are in microseconds. For buffering level is 0,
i_total_buffering is 60 * CLOCK_FREQ microseconds, demuxed amount is 0,
nz_extdeadline would be 240 microseconds. It's not the code supposed to
Signed-off-by: François Cartegnie's avatarFrancois Cartegnie <>
(cherry picked from commit d29d1440)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent 3e6c3a49
......@@ -366,7 +366,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
mtime_t nz_extdeadline = commandsqueue->getBufferingLevel() +
(i_total_buffering - commandsqueue->getDemuxedAmount()) / (CLOCK_FREQ/4);
(i_total_buffering - commandsqueue->getDemuxedAmount()) / 4;
nz_deadline = std::max(nz_deadline, nz_extdeadline);
/* need to read, demuxer still buffering, ... */
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