[vlc-devel] commit: Use provided system time instead of mdate(). (Laurent Aimar )
git version control
git at videolan.org
Sun Sep 28 13:35:57 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Sep 24 20:34:58 2008 +0200| [476ce3ee10c934473f2769afd814b9c730f0106a] | committer: Laurent Aimar
Use provided system time instead of mdate().
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=476ce3ee10c934473f2769afd814b9c730f0106a
---
src/input/clock.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/input/clock.c b/src/input/clock.c
index c405a93..b2c4c4b 100644
--- a/src/input/clock.c
+++ b/src/input/clock.c
@@ -90,15 +90,15 @@ static mtime_t ClockToSysdate( input_clock_t *cl, mtime_t i_clock )
}
/*****************************************************************************
- * ClockCurrent: converts current system date to clock units
+ * ClockFromSysdate: converts a system date to movie clock
*****************************************************************************
* Caution : a valid reference point is needed for this to operate.
*****************************************************************************/
-static mtime_t ClockCurrent( input_clock_t *cl )
+static mtime_t ClockFromSysdate( input_clock_t *cl, mtime_t i_ck_system )
{
assert( cl->b_has_reference );
- return (mdate() - cl->sysdate_ref) * INPUT_RATE_DEFAULT / cl->i_rate +
- cl->cr_ref;
+ return ( i_ck_system - cl->sysdate_ref ) * INPUT_RATE_DEFAULT / cl->i_rate +
+ cl->cr_ref;
}
/*****************************************************************************
@@ -185,7 +185,7 @@ void input_ClockSetPCR( input_thread_t *p_input,
if( !b_synchronize && i_ck_system - cl->last_update > 200000 )
{
/* Smooth clock reference variations. */
- const mtime_t i_extrapoled_clock = ClockCurrent( cl );
+ const mtime_t i_extrapoled_clock = ClockFromSysdate( cl, i_ck_system );
/* Bresenham algorithm to smooth variations. */
const mtime_t i_tmp = cl->delta_cr * (cl->i_cr_average - 1) +
( i_extrapoled_clock - i_ck_stream ) * 1 +
More information about the vlc-devel
mailing list