summaryrefslogtreecommitdiffstats
path: root/media/cast/logging
diff options
context:
space:
mode:
authorhclam <hclam@chromium.org>2015-02-09 20:10:13 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-10 04:11:20 +0000
commit5789b5e86ff09e0ec750a8c1dd2b750e49611350 (patch)
treec083830ca879a6ec5d1b8226c83cb4764ddde270 /media/cast/logging
parent55b85812d822cad3ee7a4ae95036abbee1b2e22d (diff)
downloadchromium_src-5789b5e86ff09e0ec750a8c1dd2b750e49611350.zip
chromium_src-5789b5e86ff09e0ec750a8c1dd2b750e49611350.tar.gz
chromium_src-5789b5e86ff09e0ec750a8c1dd2b750e49611350.tar.bz2
Cast: Fix incorrect end to end latency estimation
There was a spec change in the receiver that the timestamp in FRAME_PLAYOUT event is the actual (or estimated) time when the frame is rendered. Chrome kept the implementaton of the older spec and lead to an over estimation of end to end latency. BUG=b/80866356 Review URL: https://codereview.chromium.org/909883004 Cr-Commit-Position: refs/heads/master@{#315491}
Diffstat (limited to 'media/cast/logging')
-rw-r--r--media/cast/logging/stats_event_subscriber.cc4
-rw-r--r--media/cast/logging/stats_event_subscriber_unittest.cc2
2 files changed, 2 insertions, 4 deletions
diff --git a/media/cast/logging/stats_event_subscriber.cc b/media/cast/logging/stats_event_subscriber.cc
index a131cae..9d68710 100644
--- a/media/cast/logging/stats_event_subscriber.cc
+++ b/media/cast/logging/stats_event_subscriber.cc
@@ -577,9 +577,7 @@ void StatsEventSubscriber::RecordE2ELatency(const FrameEvent& frame_event) {
if (it == recent_frame_infos_.end())
return;
- // Playout time is event time + playout delay.
- base::TimeTicks playout_time =
- frame_event.timestamp + frame_event.delay_delta - receiver_offset;
+ base::TimeTicks playout_time = frame_event.timestamp - receiver_offset;
base::TimeDelta latency = playout_time - it->second.capture_time;
total_e2e_latency_ += latency;
e2e_latency_datapoints_++;
diff --git a/media/cast/logging/stats_event_subscriber_unittest.cc b/media/cast/logging/stats_event_subscriber_unittest.cc
index a33fc06..4501454 100644
--- a/media/cast/logging/stats_event_subscriber_unittest.cc
+++ b/media/cast/logging/stats_event_subscriber_unittest.cc
@@ -289,7 +289,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
int delay_micros = base::RandInt(-50000, 50000);
base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_micros);
- total_latency += latency + delay;
+ total_latency += latency;
cast_environment_->Logging()->InsertFrameEventWithDelay(
receiver_clock_.NowTicks(),