From 58e113a2de041bffab3edf9ef16b900252df4889 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 12 Apr 2019 08:46:51 +0200 Subject: [PATCH] Fix variable shadowing in RoundRobinPacketQueue::Push. Bug: webrtc:9018 Change-Id: I149b89d9ffe3e176f5afcbd82b56c1b77b11322b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132701 Reviewed-by: Sebastian Jansson Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#27579} --- modules/pacing/round_robin_packet_queue.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/pacing/round_robin_packet_queue.cc b/modules/pacing/round_robin_packet_queue.cc index e61d68215a..a87c47cee5 100644 --- a/modules/pacing/round_robin_packet_queue.cc +++ b/modules/pacing/round_robin_packet_queue.cc @@ -69,22 +69,22 @@ void RoundRobinPacketQueue::Push(const Packet& packet_to_insert) { stream_info_it->second.ssrc = packet.ssrc; } - Stream* streams_ = &stream_info_it->second; + Stream* stream = &stream_info_it->second; - if (streams_->priority_it == stream_priorities_.end()) { + if (stream->priority_it == stream_priorities_.end()) { // If the SSRC is not currently scheduled, add it to |stream_priorities_|. - RTC_CHECK(!IsSsrcScheduled(streams_->ssrc)); - streams_->priority_it = stream_priorities_.emplace( - StreamPrioKey(packet.priority, streams_->bytes), packet.ssrc); - } else if (packet.priority < streams_->priority_it->first.priority) { + RTC_CHECK(!IsSsrcScheduled(stream->ssrc)); + stream->priority_it = stream_priorities_.emplace( + StreamPrioKey(packet.priority, stream->bytes), packet.ssrc); + } else if (packet.priority < stream->priority_it->first.priority) { // If the priority of this SSRC increased, remove the outdated StreamPrioKey // and insert a new one with the new priority. Note that // RtpPacketSender::Priority uses lower ordinal for higher priority. - stream_priorities_.erase(streams_->priority_it); - streams_->priority_it = stream_priorities_.emplace( - StreamPrioKey(packet.priority, streams_->bytes), packet.ssrc); + stream_priorities_.erase(stream->priority_it); + stream->priority_it = stream_priorities_.emplace( + StreamPrioKey(packet.priority, stream->bytes), packet.ssrc); } - RTC_CHECK(streams_->priority_it != stream_priorities_.end()); + RTC_CHECK(stream->priority_it != stream_priorities_.end()); packet.enqueue_time_it = enqueue_times_.insert(packet.enqueue_time_ms); @@ -96,7 +96,7 @@ void RoundRobinPacketQueue::Push(const Packet& packet_to_insert) { // in a paused state. UpdateQueueTime(packet.enqueue_time_ms); packet.enqueue_time_ms -= pause_time_sum_ms_; - streams_->packet_queue.push(packet); + stream->packet_queue.push(packet); size_packets_ += 1; size_bytes_ += packet.bytes;