re add old calcPts

Origin commit data
------------------
Branch: master
Commit: 055fa18dbf
Author: max_10 <max_10@gmx.de>
Date: 2016-04-15 (Fri, 15 Apr 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2016-04-15 21:13:12 +02:00
parent a998b4cf2c
commit 4b03a8681f

View File

@@ -65,9 +65,9 @@ int64_t Input::calcPts(AVStream * stream, int64_t pts)
if (pts == AV_NOPTS_VALUE) if (pts == AV_NOPTS_VALUE)
return INVALID_PTS_VALUE; return INVALID_PTS_VALUE;
pts = av_rescale(90000ll * stream->time_base.num, pts, stream->time_base.den); pts = 90000 * (double)pts * stream->time_base.num / stream->time_base.den;
if (avfc->start_time != AV_NOPTS_VALUE) if (avfc->start_time != AV_NOPTS_VALUE)
pts -= av_rescale(90000ll, avfc->start_time, AV_TIME_BASE); pts -= 90000 * avfc->start_time / AV_TIME_BASE;
if (pts < 0) if (pts < 0)
return INVALID_PTS_VALUE; return INVALID_PTS_VALUE;
@@ -154,16 +154,16 @@ bool Input::Play()
seek_target = seek_avts_abs; seek_target = seek_avts_abs;
} }
seek_avts_abs = INT64_MIN; seek_avts_abs = INT64_MIN;
} else if (player->isBackWard && av_gettime() >= showtime) { } else if (player->isBackWard && av_gettime_relative() >= showtime) {
player->output.ClearVideo(); player->output.ClearVideo();
if (bof) { if (bof) {
showtime = av_gettime(); showtime = av_gettime_relative();
usleep(100000); usleep(100000);
continue; continue;
} }
seek_avts_rel = player->Speed * AV_TIME_BASE; seek_avts_rel = player->Speed * AV_TIME_BASE;
showtime = av_gettime() + 300000; //jump back every 300ms showtime = av_gettime_relative() + 300000; //jump back every 300ms
continue; continue;
} else { } else {
bof = false; bof = false;