]> git.sesse.net Git - vlc/commitdiff
Fix VLM scheduling.
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 8 Feb 2010 20:38:08 +0000 (21:38 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 8 Feb 2010 20:38:26 +0000 (21:38 +0100)
src/input/vlm.c
src/input/vlmshell.c

index 31ac195806dd081ab054e2b2bae2e7ac72fa9968..650d87f6509ee809cc6db9a545a67e4717956883 100644 (file)
@@ -147,7 +147,7 @@ vlm_t *vlm_New ( vlc_object_t *p_this )
 
     vlc_mutex_init( &p_vlm->lock );
     vlc_mutex_init( &p_vlm->lock_manage );
-    vlc_cond_init( &p_vlm->wait_manage );
+    vlc_cond_init_daytime( &p_vlm->wait_manage );
     p_vlm->i_id = 1;
     TAB_INIT( p_vlm->i_media, p_vlm->media );
     TAB_INIT( p_vlm->i_schedule, p_vlm->schedule );
@@ -375,7 +375,7 @@ static void* Manage( void* p_object )
 
         vlc_mutex_lock( &vlm->lock_manage );
         if( i_nextschedule )
-            vlc_cond_timedwait( &vlm->wait_manage, &vlm->lock_manage, i_nextschedule-mdate() );
+            vlc_cond_timedwait( &vlm->wait_manage, &vlm->lock_manage, i_nextschedule );
         else
             vlc_cond_wait( &vlm->wait_manage, &vlm->lock_manage );
         vlc_mutex_unlock( &vlm->lock_manage );
index a1eec6b2e64f920b37a5daf56d94870cf2694a12..db5d005a9bdb2b632a5669c517cc342384e3bed8 100644 (file)
@@ -664,6 +664,11 @@ static int ExecuteScheduleProperty( vlm_t *p_vlm, vlm_schedule_sys_t *p_schedule
         }
     }
     *pp_status = vlm_MessageSimpleNew( psz_cmd );
+
+    vlc_mutex_lock( &p_vlm->lock_manage );
+    vlc_cond_signal( &p_vlm->wait_manage );
+    vlc_mutex_unlock( &p_vlm->lock_manage );
+
     return VLC_SUCCESS;
 
 error:
@@ -996,10 +1001,6 @@ static vlm_schedule_sys_t *vlm_ScheduleNew( vlm_t *vlm, const char *psz_name )
 
     TAB_APPEND( vlm->i_schedule, vlm->schedule, p_sched );
 
-    vlc_mutex_lock( &vlm->lock_manage );
-    vlc_cond_signal( &vlm->wait_manage );
-    vlc_mutex_unlock( &vlm->lock_manage );
-
     return p_sched;
 }
 
@@ -1217,6 +1218,7 @@ static int vlm_ScheduleSetup( vlm_schedule_sys_t *schedule, const char *psz_cmd,
     {
         return 1;
     }
+
     return 0;
 }