[vlc-commits] playlist: fix temporization delays

Romain Vimont git at videolan.org
Mon May 27 11:12:58 CEST 2019


vlc/vlc-3.0 | branch: master | Romain Vimont <rom1v at videolabs.io> | Sat May 25 12:01:48 2019 +0200| [118d6aab86860451c08ffbcda68434c11a105b9b] | committer: Jean-Baptiste Kempf

playlist: fix temporization delays

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.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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);



More information about the vlc-commits mailing list