[vlc-commits] demux: adaptive: fix deadline maths

Zhao Zhili git at videolan.org
Wed Jan 17 16:13:17 CET 2018


vlc/vlc-3.0 | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Wed Jan 17 11:33:38 2018 +0800| [28bf614023fef9e0fd9fec9fba0943dffd3a4496] | committer: 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
do.

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
(cherry picked from commit d29d14402e887d4a8a5a8406d23142596999669f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=28bf614023fef9e0fd9fec9fba0943dffd3a4496
---

 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, ... */



More information about the vlc-commits mailing list