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

Unified Diff: webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc

Issue 2099243003: Use std::unique_ptr in ForwardErrorCorrection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@flexfec-pt1a_mini-fixes-in-ULPFEC
Patch Set: Response to PS4 feedback. Created 4 years, 6 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 | « no previous file | webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
index 29cde65b1289b4151edaa030276176c55c009f5b..c09f0dc6e0bdeed88ccefa2f17b08ac761cece68 100644
--- a/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
@@ -29,10 +29,7 @@ FecReceiverImpl::FecReceiverImpl(RtpData* callback)
fec_(new ForwardErrorCorrection()) {}
FecReceiverImpl::~FecReceiverImpl() {
- while (!received_packet_list_.empty()) {
- delete received_packet_list_.front();
- received_packet_list_.pop_front();
- }
+ received_packet_list_.clear();
if (fec_ != NULL) {
fec_->ResetState(&recovered_packet_list_);
delete fec_;
@@ -209,9 +206,9 @@ int32_t FecReceiverImpl::AddReceivedRedPacket(
return 0;
}
- received_packet_list_.push_back(received_packet.release());
+ received_packet_list_.push_back(std::move(received_packet));
if (second_received_packet) {
- received_packet_list_.push_back(second_received_packet.release());
+ received_packet_list_.push_back(std::move(second_received_packet));
}
return 0;
}
@@ -237,7 +234,7 @@ int32_t FecReceiverImpl::ProcessReceivedFec() {
RTC_DCHECK(received_packet_list_.empty());
}
// Send any recovered media packets to VCM.
- for(auto* recovered_packet : recovered_packet_list_) {
+ for(auto& recovered_packet : recovered_packet_list_) {
stefan-webrtc 2016/07/05 08:51:38 for (const auto&
brandtr 2016/07/05 10:28:00 Done.
if (recovered_packet->returned) {
// Already sent to the VCM and the jitter buffer.
continue;
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698