]> git.sesse.net Git - vlc/commitdiff
Do not forget to use the drift when converting stream to system clock.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 12 Jul 2009 22:06:45 +0000 (00:06 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 13 Jul 2009 19:13:13 +0000 (21:13 +0200)
It has no consequence (because of the way we actually use the clock) but
it is more consistent.

src/input/clock.c

index dc010e531288a447a7aa1f14eb39ad6acf66bd9d..0b24c29ad6902d3e67de9f2b004d07f8d791d3f8 100644 (file)
@@ -274,7 +274,7 @@ void input_clock_ChangeRate( input_clock_t *cl, int i_rate )
     /* Move the reference point */
     if( cl->b_has_reference )
     {
-        cl->last.i_system = ClockStreamToSystem( cl, cl->last.i_stream );
+        cl->last.i_system = ClockStreamToSystem( cl, cl->last.i_stream + AvgGet( &cl->drift ) );
         cl->ref = cl->last;
     }
 
@@ -318,7 +318,7 @@ mtime_t input_clock_GetWakeup( input_clock_t *cl )
 
     /* Synchronized, we can wait */
     if( cl->b_has_reference )
-        i_wakeup = ClockStreamToSystem( cl, cl->last.i_stream );
+        i_wakeup = ClockStreamToSystem( cl, cl->last.i_stream + AvgGet( &cl->drift ) );
 
     vlc_mutex_unlock( &cl->lock );