diff options
author | imcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 03:36:55 +0000 |
---|---|---|
committer | imcheng@chromium.org <imcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 03:36:55 +0000 |
commit | 9be32acf2d854d325ed27d324cdf7d08f0587dfa (patch) | |
tree | a6468ceed8945dee64a42f92a8abd7d49d3391b1 /media/cast/logging | |
parent | 0927cb49c8689e372c797aa6ab89a4fd69a3b137 (diff) | |
download | chromium_src-9be32acf2d854d325ed27d324cdf7d08f0587dfa.zip chromium_src-9be32acf2d854d325ed27d324cdf7d08f0587dfa.tar.gz chromium_src-9be32acf2d854d325ed27d324cdf7d08f0587dfa.tar.bz2 |
Cast: Fix encoding event subscriber log packet size.
Previously we set the packet size in BasePacketEvent proto during
construction and never overwrite it. The problem is that the proto is
most often created as a result of seeing a receiver packet event first,
which does not contain packet size information and thus the size field
is set to 0. We'd need to overwrite the size field when we see a sender
packet event, which contains packet size information.
Most of the time we see receiver event first because they often arrive
sooner (via RTCP packets) than sender events (via IPC every second).
Review URL: https://codereview.chromium.org/272873002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269513 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/cast/logging')
-rw-r--r-- | media/cast/logging/encoding_event_subscriber.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/cast/logging/encoding_event_subscriber.cc b/media/cast/logging/encoding_event_subscriber.cc index e2eb37a..4940465 100644 --- a/media/cast/logging/encoding_event_subscriber.cc +++ b/media/cast/logging/encoding_event_subscriber.cc @@ -178,6 +178,13 @@ void EncodingEventSubscriber::OnReceivePacketEvent( base_packet_event_proto->add_event_timestamp_ms( (packet_event.timestamp - base::TimeTicks()).InMilliseconds()); + // |base_packet_event_proto| could have been created with a receiver event + // which does not have the packet size and we would need to overwrite it when + // we see a sender event, which does have the packet size. + if (packet_event.size > 0) { + base_packet_event_proto->set_size(packet_event.size); + } + if (packet_event_map_.size() > kMaxMapSize) TransferPacketEvents(kNumMapEntriesToTransfer); |