Make sure timestamps are monotonically increasing.

BUG=1563

Review URL: https://webrtc-codereview.appspot.com/1325008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3898 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org 2013-04-24 23:54:31 +00:00
parent c63772eb39
commit cb60fb2e6c

View File

@ -194,10 +194,11 @@ int32_t VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame& captureFrame,
}
// Set the capture time
const int64_t ntp_time_ms =
Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
int64_t internal_capture_time = TickTime::MillisecondTimestamp();
if (capture_time != 0) {
int64_t time_since_capture =
Clock::GetRealTimeClock()->CurrentNtpInMilliseconds() - capture_time;
int64_t time_since_capture = ntp_time_ms - capture_time;
internal_capture_time -= time_since_capture;
captureFrame.set_render_time_ms(internal_capture_time);
}