]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Fix invalid time
authorMarten Richter <marten.richter@freenet.de>
Sun, 4 Nov 2012 13:21:32 +0000 (14:21 +0100)
committerMarten Richter <marten.richter@freenet.de>
Sun, 4 Nov 2012 13:21:32 +0000 (14:21 +0100)
demuxerts.cc
videoomx.cc

index ec83d112bbc4913f92ab6e12ebd6eb4a546059f5..afcdba6b9ccb018460e6effb3f717d89a0fd35d3 100644 (file)
@@ -705,7 +705,7 @@ ULONG DemuxerTS::getFrameNumFromPTS(ULLONG pts)
   while (iter != pts_map.end())\r
   {\r
     ++total;\r
-     //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts1 %lld pts2 %lld", pts, iter->pts);\r
+    //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts1 %lld pts2 %lld", pts, iter->pts);\r
     if (PTSDifference(iter->pts, pts) < PTS_ALLOWANCE)\r
     {\r
       difference = 0;\r
@@ -785,6 +785,7 @@ void DemuxerTS::parseTSPacketDetails(PESPacket &packet) // Only important stuff
       double tfps=fps;\r
      // if (doubledframerate) tfps*=2.;\r
       ULLONG pts_expected = me.pts + 90000*((int)(((double)(frame_num - me.frame)) / tfps));\r
+\r
       while (pts_expected > (1LL<<33)) pts_expected -= (1LL<<33);\r
 \r
       // this was a workaround for a vdr bug, now fixed, for older recordings deleter the index file\r
index 45946e8ab8367b04279999d1b7f3624279da0eae..b2c9c37b3634d4c3f68173b8fb2bc6e75b25c787 100644 (file)
@@ -2178,6 +2178,7 @@ ULLONG VideoOMX::getCurrentTimestamp() {
        //ncur_clock_time -= startoffset;
        ncur_clock_time -= lastreftimeOMX;
        long long result = lastreftimePTS;
+       if (lastreftimePTS==0) return 0; // invalid time
        result += (long long) (ncur_clock_time / 10000LL * 90LL);
        if (result < 0)
                result = (1LL << 33) - result;