[vlc-devel] [PATCH] demux: adaptive: fix deadline maths

Zhao Zhili quinkblack at foxmail.com
Wed Jan 17 04:33:38 CET 2018


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
do.
---
 modules/demux/adaptive/Streams.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index ecb3efc68b..06756fdd01 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -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, ... */
-- 
2.16.0-rc1





More information about the vlc-devel mailing list