Index: media/cast/video_receiver/video_receiver.cc |
diff --git a/media/cast/video_receiver/video_receiver.cc b/media/cast/video_receiver/video_receiver.cc |
index 799da9a2d48b364b3bbf088c2a19d0035a299062..113845c69600a570229de991a0c81e2df898e97f 100644 |
--- a/media/cast/video_receiver/video_receiver.cc |
+++ b/media/cast/video_receiver/video_receiver.cc |
@@ -107,6 +107,7 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment, |
incoming_payload_callback_.get()), |
rtp_video_receiver_statistics_( |
new LocalRtpReceiverStatistics(&rtp_receiver_)), |
+ time_offset_counter_(0), |
decryptor_(), |
time_incoming_packet_updated_(false), |
incoming_rtp_timestamp_(0), |
@@ -365,6 +366,7 @@ base::TimeTicks VideoReceiver::GetRenderTime(base::TimeTicks now, |
return now; |
} |
time_offset_ = time_incoming_packet_ - rtp_timestamp_in_ticks; |
+ ++time_offset_counter_; |
} else if (time_incoming_packet_updated_) { |
if (rtcp_->RtpTimestampInSenderTime(kVideoFrequency, |
incoming_rtp_timestamp_, |
@@ -372,8 +374,9 @@ base::TimeTicks VideoReceiver::GetRenderTime(base::TimeTicks now, |
// Time to update the time_offset. |
base::TimeDelta time_offset = |
time_incoming_packet_ - rtp_timestamp_in_ticks; |
- time_offset_ = ((kTimeOffsetFilter - 1) * time_offset_ + time_offset) / |
- kTimeOffsetFilter; |
+ if (time_offset_counter_ < 10 && time_offset < time_offset_) |
+ time_offset_ = time_offset; |
+ ++time_offset_counter_; |
hguihot1
2014/03/03 23:20:59
The previous filter was basically doing:
time_off
mikhal1
2014/03/03 23:33:23
That is indeed part of the problem, which can be d
pwestin
2014/03/03 23:35:47
Mikhal based on the date we have seen in testing I
mikhal1
2014/03/04 00:02:37
True, just thought of it as I was responding to hg
|
} |
} |
// Reset |time_incoming_packet_updated_| to enable a future measurement. |