[vlc-devel] [PATCH VLC3] playlist: fix temporization delays

Romain Vimont rom1v at videolabs.io
Sat May 25 12:01:48 CEST 2019


The slowdown multiplicator started at 2^1 (2) instead of 2^0 (1).

As a result, the delays were:

    200ms, 400ms, 800ms, 1.6s, 3.2s, 6.4s

instead of:

    100ms, 200ms, 400ms, 800ms, 1.6s, 3.2s

as expected and documented.
---
 src/playlist/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 8f2d1ca876..b78f31a7ea 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -506,7 +506,7 @@ static void *Thread ( void *data )
                 if (p_sys->i_consecutive_errors < 6)
                     p_sys->i_consecutive_errors++;
 
-                int slowdown = 1 << p_sys->i_consecutive_errors;
+                int slowdown = 1 << (p_sys->i_consecutive_errors - 1);
                 /* 100ms, 200ms, 400ms, 800ms, 1.6s, 3.2s */
                 mtime_t deadline = mdate() + slowdown * 100000L; /* usecs */
                 vlc_cond_timedwait(&p_sys->signal, &p_sys->lock, deadline);
-- 
2.20.1



More information about the vlc-devel mailing list