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 |
11 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" | 11 #include "webrtc/modules/audio_coding/neteq/timestamp_scaler.h" |
12 | 12 |
13 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" | 13 #include "webrtc/modules/audio_coding/neteq/decoder_database.h" |
14 #include "webrtc/modules/audio_coding/neteq/defines.h" | 14 #include "webrtc/modules/audio_coding/neteq/defines.h" |
15 #include "webrtc/system_wrappers/interface/logging.h" | 15 #include "webrtc/system_wrappers/include/logging.h" |
16 | 16 |
17 namespace webrtc { | 17 namespace webrtc { |
18 | 18 |
19 void TimestampScaler::Reset() { | 19 void TimestampScaler::Reset() { |
20 first_packet_received_ = false; | 20 first_packet_received_ = false; |
21 } | 21 } |
22 | 22 |
23 void TimestampScaler::ToInternal(Packet* packet) { | 23 void TimestampScaler::ToInternal(Packet* packet) { |
24 if (!packet) { | 24 if (!packet) { |
25 return; | 25 return; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } else { | 104 } else { |
105 int32_t internal_diff = internal_timestamp - internal_ref_; | 105 int32_t internal_diff = internal_timestamp - internal_ref_; |
106 assert(numerator_ > 0); // Should not be possible. | 106 assert(numerator_ > 0); // Should not be possible. |
107 // Do not update references in this method. | 107 // Do not update references in this method. |
108 // Switch |denominator_| and |numerator_| to convert the other way. | 108 // Switch |denominator_| and |numerator_| to convert the other way. |
109 return external_ref_ + (internal_diff * denominator_) / numerator_; | 109 return external_ref_ + (internal_diff * denominator_) / numerator_; |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 } // namespace webrtc | 113 } // namespace webrtc |
OLD | NEW |