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

Francois Cartegnie git at videolan.org
Tue Jun 26 23:21:33 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 26 23:06:51 2018 +0200| [7655b6cc2ae55b8d2505b3869e72e16cd6a69425] | committer: Francois Cartegnie

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7655b6cc2ae55b8d2505b3869e72e16cd6a69425
---

 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 8bb3c35504..792f8facf9 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -446,10 +446,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 )
                 {
@@ -468,7 +470,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