From 47e5a351591e96431bbf9b0050d3053b2d0fe055 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 11 Mar 2010 14:13:17 +0000 Subject: [PATCH] *** empty log message *** --- demuxerts.cc | 1 + videowin.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/demuxerts.cc b/demuxerts.cc index 5fac53f..25b4de4 100644 --- a/demuxerts.cc +++ b/demuxerts.cc @@ -615,6 +615,7 @@ ULONG DemuxerTS::getFrameNumFromPTS(ULLONG pts) ULLONG difference = (1LL<<33); ULONG ref_frame = 0; int total = 0, actual = 0; + if (pts==0) return 0; //we are in startup pts_map_mutex.Lock(); PTSMap::iterator iter = pts_map.begin(); while (iter != pts_map.end()) diff --git a/videowin.cc b/videowin.cc index 357f5a7..b62861c 100644 --- a/videowin.cc +++ b/videowin.cc @@ -1553,12 +1553,14 @@ ULLONG VideoWin::getCurrentTimestamp() if (state==State_Running) dsrefclock->GetTime(&cr_time); ncr_time=cr_time; startoffset=sourcefilter->getStartOffset(); + if (startoffset==0) return 0; ncr_time-=startoffset; ncr_time-=lastreftimeRT; /* ULLONG result=frameNumberToTimecode( VDR::getInstance()->frameNumberFromPosition(lastreftimeBYTE));*/ - ULLONG result=lastreftimePTS; + long long result=lastreftimePTS; result+=(ULLONG)(ncr_time/10000LL*90LL); + if (result<0) result=(1LL << 33)-result; return result; } -- 2.39.5