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
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
//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;