Slight logspam reduction
No need to log when set_current_direction() doesn't change the state.
Bug: none
Change-Id: I060fb106f1338373ba8102d4c78aaef71a9c6831
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/416400
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45912}
diff --git a/pc/rtp_transceiver.cc b/pc/rtp_transceiver.cc
index 8ce6e69..a602139 100644
--- a/pc/rtp_transceiver.cc
+++ b/pc/rtp_transceiver.cc
@@ -500,13 +500,14 @@
}
void RtpTransceiver::set_current_direction(RtpTransceiverDirection direction) {
+ if (current_direction_ == direction)
+ return;
RTC_LOG(LS_INFO) << "Changing transceiver (MID=" << mid_.value_or("<not set>")
<< ") current direction from "
<< (current_direction_ ? RtpTransceiverDirectionToString(
*current_direction_)
: "<not set>")
- << " to " << RtpTransceiverDirectionToString(direction)
- << ".";
+ << " to " << RtpTransceiverDirectionToString(direction);
current_direction_ = direction;
if (RtpTransceiverDirectionHasSend(*current_direction_)) {
has_ever_been_used_to_send_ = true;