diff options
author | phintuka <phintuka> | 2008-04-20 21:29:29 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-04-20 21:29:29 +0000 |
commit | ae7c1e84f8c60598d6f9a30e63edccaa9a6faead (patch) | |
tree | fef57e86c0a2d09262016474f1c4665a11217192 /tools/time_pts.c | |
parent | 4099909c3242dc4187b5bac69f8d006309c0b788 (diff) | |
download | xineliboutput-ae7c1e84f8c60598d6f9a30e63edccaa9a6faead.tar.gz xineliboutput-ae7c1e84f8c60598d6f9a30e63edccaa9a6faead.tar.bz2 |
Added SetScrSpeed (fine-tuning of UDP/RTP stream master clock)
Diffstat (limited to 'tools/time_pts.c')
-rw-r--r-- | tools/time_pts.c | 14 |
1 files changed, 11 insertions, 3 deletions
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; +} |