Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Unified Diff: media/cast/audio_sender/audio_sender.cc

Issue 147993010: Cast: end2end bug fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + nits Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/audio_sender/audio_encoder.cc ('k') | media/cast/cast_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/audio_sender/audio_sender.cc
diff --git a/media/cast/audio_sender/audio_sender.cc b/media/cast/audio_sender/audio_sender.cc
index 8bd0427d2cec184905138a0d5b2911136d565c24..66027e4e967f898694a8616f180a436dec4b4ccb 100644
--- a/media/cast/audio_sender/audio_sender.cc
+++ b/media/cast/audio_sender/audio_sender.cc
@@ -50,16 +50,23 @@ class LocalRtpSenderStatistics : public RtpSenderStatistics {
virtual void GetStatistics(const base::TimeTicks& now,
transport::RtcpSenderInfo* sender_info) OVERRIDE {
- // Update RTP timestamp and return last stored statistics.
- if (rtp_timestamp_) {
+ // Update and return last stored statistics.
+ uint32 ntp_seconds = 0;
+ uint32 ntp_fraction = 0;
+ uint32 rtp_timestamp = 0;
+ if (rtp_timestamp_ > 0) {
base::TimeDelta time_since_last_send = now - time_sent_;
- sender_info_.rtp_timestamp =
- rtp_timestamp_ +
- time_since_last_send.InMilliseconds() * (frequency_ / 1000);
- } else {
- sender_info_.rtp_timestamp = 0;
+ rtp_timestamp = rtp_timestamp_ + time_since_last_send.InMilliseconds() *
+ (frequency_ / 1000);
+ // Update NTP time to current time.
+ ConvertTimeTicksToNtp(now, &ntp_seconds, &ntp_fraction);
}
- memcpy(sender_info, &sender_info_, sizeof(transport::RtcpSenderInfo));
+ // Populate sender info.
+ sender_info->rtp_timestamp = rtp_timestamp;
+ sender_info->ntp_seconds = sender_info_.ntp_seconds;
+ sender_info->ntp_fraction = sender_info_.ntp_fraction;
+ sender_info->send_packet_count = sender_info_.send_packet_count;
+ sender_info->send_octet_count = sender_info_.send_octet_count;
}
void StoreStatistics(transport::RtcpSenderInfo& sender_info,
« no previous file with comments | « media/cast/audio_sender/audio_encoder.cc ('k') | media/cast/cast_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698