Fix video_loopback to work with -duration flag: add missing ntp_timestamp to frames

BUG=none

Review-Url: https://codereview.webrtc.org/2852463002
Cr-Commit-Position: refs/heads/master@{#17967}
This commit is contained in:
ilnik 2017-05-02 00:48:41 -07:00 committed by Commit bot
parent 78ef2c7da7
commit b82ac6aed3

View File

@ -909,11 +909,13 @@ class VideoAnalyzer : public PacketReceiver,
// Frames from the capturer does not have a rtp timestamp.
// Create one so it can be used for comparison.
RTC_DCHECK_EQ(0, video_frame.timestamp());
if (copy.ntp_time_ms() == 0)
copy.set_ntp_time_ms(rtc::TimeMillis());
copy.set_timestamp(copy.ntp_time_ms() * 90);
analyzer_->AddCapturedFrameForComparison(copy);
rtc::CritScope lock(&crit_);
if (send_stream_input_)
send_stream_input_->OnFrame(video_frame);
send_stream_input_->OnFrame(copy);
}
// Called when |send_stream_.SetSource()| is called.