Let PacketSource::NextPacket() return an std::unique_ptr
The return type of PacketSource::NextPacket() is changed from a naked
pointer to an std::uniqe_ptr. The interface contract was and still is
that the ownership is passed from the callee to the caller, but a
unique_ptr makes this explicit.
BUG=webrtc:2692
Review-Url: https://codereview.webrtc.org/2005873002
Cr-Commit-Position: refs/heads/master@{#12884}
diff --git a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
index 4a6f505..24a8774 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
@@ -349,7 +349,7 @@
(output_sample_rate_ / 1000))));
}
// Get next packet.
- packet_.reset(rtp_source_->NextPacket());
+ packet_ = rtp_source_->NextPacket();
}
// Get audio from NetEq.
@@ -387,7 +387,7 @@
gen_ref ? webrtc::test::OutputPath() + "neteq_rtcp_stats.dat" : "";
ResultSink rtcp_stats(rtcp_out_file);
- packet_.reset(rtp_source_->NextPacket());
+ packet_ = rtp_source_->NextPacket();
int i = 0;
while (packet_) {
std::ostringstream ss;