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

Unified Diff: webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc

Issue 2005873002: Let PacketSource::NextPacket() return an std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 7 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
Index: webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
index 84e866e3617781ce44654804bdfe74c7ff8bd682..bee973048eaf9beea90716016d74d2a887f7db6d 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
@@ -493,7 +493,7 @@ int main(int argc, char* argv[]) {
replacement_audio.reset(new int16_t[input_frame_size_timestamps]);
payload_mem_size_bytes = 2 * input_frame_size_timestamps;
payload.reset(new uint8_t[payload_mem_size_bytes]);
- next_packet.reset(file_source->NextPacket());
+ next_packet = file_source->NextPacket();
assert(next_packet);
next_packet_available = true;
}
@@ -566,9 +566,9 @@ int main(int argc, char* argv[]) {
}
// Get next packet from file.
- Packet* temp_packet = file_source->NextPacket();
+ std::unique_ptr<Packet> temp_packet = file_source->NextPacket();
if (temp_packet) {
- packet.reset(temp_packet);
+ packet = std::move(temp_packet);
if (replace_payload) {
// At this point |packet| contains the packet *after* |next_packet|.
// Swap Packet objects between |packet| and |next_packet|.
@@ -586,6 +586,7 @@ int main(int argc, char* argv[]) {
next_input_time_ms = std::numeric_limits<int64_t>::max();
packet_available = false;
}
+ RTC_DCHECK(!temp_packet); // Must have transferred to another variable.
}
// Check if it is time to get output audio.

Powered by Google App Engine
This is Rietveld 408576698