From ae7c1e84f8c60598d6f9a30e63edccaa9a6faead Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 20 Apr 2008 21:29:29 +0000 Subject: Added SetScrSpeed (fine-tuning of UDP/RTP stream master clock) --- tools/time_pts.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tools/time_pts.c') diff --git a/tools/time_pts.c b/tools/time_pts.c index 23d1ce29..7bf410ce 100644 --- a/tools/time_pts.c +++ b/tools/time_pts.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: time_pts.c,v 1.2 2008-04-20 17:51:45 phintuka Exp $ + * $Id: time_pts.c,v 1.3 2008-04-20 21:29:29 phintuka Exp $ * */ @@ -61,6 +61,7 @@ void cTimePts::Init(void) cTimePts::cTimePts(void) { m_Paused = false; + m_ScrSpeed = 90000; m_Multiplier = 90000; Init(); @@ -106,8 +107,9 @@ int64_t cTimePts::Now(void) t.tv_usec -= tbegin.tv_usec; int64_t pts = 0; - pts += ((int64_t)t.tv_sec) * INT64_C(90000); - pts += ((int64_t)t.tv_usec) * INT64_C(90) / INT64_C(1000); + pts += (int64_t)t.tv_sec * (int64_t)m_ScrSpeed; + pts += (int64_t)t.tv_usec * (int64_t)m_ScrSpeed / INT64_C(1000000); + if(m_Multiplier != 90000) pts = pts * m_Multiplier / INT64_C(90000); @@ -162,3 +164,9 @@ void cTimePts::TrickSpeed(int Multiplier) LOGERR("cTimePts::SetSpeed: Multiplier=%d", Multiplier); } +void cTimePts::SetScrSpeed(int ScrSpeed) +{ + Set(Now()); + + m_ScrSpeed = ScrSpeed; +} -- cgit v1.2.3