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 LOG(LS_WARNING) << "SplitRed length mismatch"; | 103 LOG(LS_WARNING) << "SplitRed length mismatch"; |
104 ret = false; | 104 ret = false; |
105 break; | 105 break; |
106 } | 106 } |
107 | 107 |
108 Packet new_packet; | 108 Packet new_packet; |
109 new_packet.timestamp = new_header.timestamp; | 109 new_packet.timestamp = new_header.timestamp; |
110 new_packet.payload_type = new_header.payload_type; | 110 new_packet.payload_type = new_header.payload_type; |
111 new_packet.sequence_number = red_packet.sequence_number; | 111 new_packet.sequence_number = red_packet.sequence_number; |
112 new_packet.priority.red_level = | 112 new_packet.priority.red_level = |
113 rtc::checked_cast<int>((new_headers.size() - 1) - i); | 113 rtc::dchecked_cast<int>((new_headers.size() - 1) - i); |
114 new_packet.payload.SetData(payload_ptr, payload_length); | 114 new_packet.payload.SetData(payload_ptr, payload_length); |
115 new_packets.push_front(std::move(new_packet)); | 115 new_packets.push_front(std::move(new_packet)); |
116 payload_ptr += payload_length; | 116 payload_ptr += payload_length; |
117 } | 117 } |
118 // Insert new packets into original list, before the element pointed to by | 118 // Insert new packets into original list, before the element pointed to by |
119 // iterator |it|. | 119 // iterator |it|. |
120 packet_list->splice(it, std::move(new_packets)); | 120 packet_list->splice(it, std::move(new_packets)); |
121 } else { | 121 } else { |
122 LOG(LS_WARNING) << "SplitRed too many blocks: " << new_headers.size(); | 122 LOG(LS_WARNING) << "SplitRed too many blocks: " << new_headers.size(); |
123 ret = false; | 123 ret = false; |
(...skipping 29 matching lines...) Expand all Loading... |
153 continue; | 153 continue; |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 ++it; | 157 ++it; |
158 } | 158 } |
159 return num_deleted_packets; | 159 return num_deleted_packets; |
160 } | 160 } |
161 | 161 |
162 } // namespace webrtc | 162 } // namespace webrtc |
OLD | NEW |