[vlc-commits] input: vlm: fix 'now' date scheduling

Francois Cartegnie git at videolan.org
Wed Jun 27 11:28:08 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 26 23:06:51 2018 +0200| [5dc2069428f5f33479ef29a305300e57a015b98d] | committer: Jean-Baptiste Kempf

input: vlm: fix 'now' date scheduling

Since the times have moved from mtime_t to time_t,
both lastcheck and now have same value over
the two successive calls.
It is then never scheduled, or only on next
condsignal or wall clock scheduled command.

(cherry picked from commit 7655b6cc2ae55b8d2505b3869e72e16cd6a69425)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/input/vlm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 99e0e5862b..2158233b5c 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -449,10 +449,12 @@ static void* Manage( void* p_object )
 
             if( vlm->schedule[i]->b_enabled )
             {
+                bool b_now = false;
                 if( vlm->schedule[i]->date == 0 ) // now !
                 {
                     vlm->schedule[i]->date = now;
                     real_date = now;
+                    b_now = true;
                 }
                 else if( vlm->schedule[i]->period != 0 )
                 {
@@ -471,7 +473,7 @@ static void* Manage( void* p_object )
 
                 if( real_date <= now )
                 {
-                    if( real_date > lastcheck )
+                    if( real_date > lastcheck || b_now )
                     {
                         for( int j = 0; j < vlm->schedule[i]->i_command; j++ )
                         {



More information about the vlc-commits mailing list