bug 1194558 correct time conversion for video frame timestamps r=roc

MediaTimeToSeconds() works fine for negative intervals

--HG--
extra : rebase_source : 8698761e28a54e6bd172a032c62e03b96ac66bfa
This commit is contained in:
Karl Tomlinson 2015-08-13 17:07:49 +12:00
Родитель 47185cd76f
Коммит 257b2b6cc9
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -1166,7 +1166,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream)
GraphTime startTime = StreamTimeToGraphTime(aStream,
start, INCLUDE_TRAILING_BLOCKED_INTERVAL);
TimeStamp targetTime = CurrentDriver()->GetCurrentTimeStamp() +
TimeDuration::FromMilliseconds(double(startTime - IterationEnd()));
TimeDuration::FromSeconds(MediaTimeToSeconds(startTime - IterationEnd()));
for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) {
VideoFrameContainer* output = aStream->mVideoOutputs[i];

Просмотреть файл

@ -448,7 +448,8 @@ public:
double MediaTimeToSeconds(GraphTime aTime) const
{
NS_ASSERTION(0 <= aTime && aTime <= STREAM_TIME_MAX, "Bad time");
NS_ASSERTION(aTime > -STREAM_TIME_MAX && aTime <= STREAM_TIME_MAX,
"Bad time");
return static_cast<double>(aTime)/GraphRate();
}