OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 rtcp.front().ntp_frac); | 103 rtcp.front().ntp_frac); |
104 int64_t rtcp_ntp_ms_old = Clock::NtpToMs(rtcp.back().ntp_secs, | 104 int64_t rtcp_ntp_ms_old = Clock::NtpToMs(rtcp.back().ntp_secs, |
105 rtcp.back().ntp_frac); | 105 rtcp.back().ntp_frac); |
106 int64_t rtcp_timestamp_new = rtcp.front().rtp_timestamp; | 106 int64_t rtcp_timestamp_new = rtcp.front().rtp_timestamp; |
107 int64_t rtcp_timestamp_old = rtcp.back().rtp_timestamp; | 107 int64_t rtcp_timestamp_old = rtcp.back().rtp_timestamp; |
108 if (!CompensateForWrapAround(rtcp_timestamp_new, | 108 if (!CompensateForWrapAround(rtcp_timestamp_new, |
109 rtcp_timestamp_old, | 109 rtcp_timestamp_old, |
110 &rtcp_timestamp_new)) { | 110 &rtcp_timestamp_new)) { |
111 return false; | 111 return false; |
112 } | 112 } |
113 if (rtcp_timestamp_new < rtcp_timestamp_old) { | |
stefan-webrtc
2016/09/28 09:18:05
Remove {}
åsapersson
2016/09/29 07:25:16
Done.
| |
114 return false; | |
stefan-webrtc
2016/09/28 09:18:05
Should we add a warning?
åsapersson
2016/09/29 07:25:16
Maybe UpdateRtcpList should be updated to have thi
stefan-webrtc
2016/09/30 08:40:46
Ok
| |
115 } | |
113 double freq_khz; | 116 double freq_khz; |
114 if (!CalculateFrequency(rtcp_ntp_ms_new, | 117 if (!CalculateFrequency(rtcp_ntp_ms_new, |
115 rtcp_timestamp_new, | 118 rtcp_timestamp_new, |
116 rtcp_ntp_ms_old, | 119 rtcp_ntp_ms_old, |
117 rtcp_timestamp_old, | 120 rtcp_timestamp_old, |
118 &freq_khz)) { | 121 &freq_khz)) { |
119 return false; | 122 return false; |
120 } | 123 } |
121 double offset = rtcp_timestamp_new - freq_khz * rtcp_ntp_ms_new; | 124 double offset = rtcp_timestamp_new - freq_khz * rtcp_ntp_ms_new; |
122 int64_t rtp_timestamp_unwrapped; | 125 int64_t rtp_timestamp_unwrapped; |
(...skipping 21 matching lines...) Expand all Loading... | |
144 } | 147 } |
145 } else if (static_cast<int32_t>(old_timestamp - new_timestamp) > 0) { | 148 } else if (static_cast<int32_t>(old_timestamp - new_timestamp) > 0) { |
146 // This difference should be less than -2^31 if we have had a backward wrap | 149 // This difference should be less than -2^31 if we have had a backward wrap |
147 // around. Since it is cast to a int32_t, it should be positive. | 150 // around. Since it is cast to a int32_t, it should be positive. |
148 return -1; | 151 return -1; |
149 } | 152 } |
150 return 0; | 153 return 0; |
151 } | 154 } |
152 | 155 |
153 } // namespace webrtc | 156 } // namespace webrtc |
OLD | NEW |