From 0a6510ddf92c08b29a9762b3318a71536bfd85d5 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Fri, 4 Oct 2019 09:31:08 +0200 Subject: [PATCH] Removes rtp_transport checks in AudioSendStream There's already a DCHECK at construction time ensuring that it's set. Bug: webrtC:9883 Change-Id: I9f41b77273bb859626546ab3534d483d9172ea5d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155581 Commit-Queue: Sebastian Jansson Reviewed-by: Oskar Sundbom Cr-Commit-Position: refs/heads/master@{#29393} --- audio/audio_send_stream.cc | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc index 401e8595b2..7f42d73ad3 100644 --- a/audio/audio_send_stream.cc +++ b/audio/audio_send_stream.cc @@ -195,21 +195,16 @@ AudioSendStream::AudioSendStream( ConfigureStream(config, true); pacer_thread_checker_.Detach(); - if (rtp_transport_) { - // Signal congestion controller this object is ready for OnPacket* - // callbacks. - rtp_transport_->RegisterPacketFeedbackObserver(this); - } + // Signal congestion controller this object is ready for OnPacket* callbacks. + rtp_transport_->RegisterPacketFeedbackObserver(this); } AudioSendStream::~AudioSendStream() { RTC_DCHECK(worker_thread_checker_.IsCurrent()); RTC_LOG(LS_INFO) << "~AudioSendStream: " << config_.rtp.ssrc; RTC_DCHECK(!sending_); - if (rtp_transport_) { - rtp_transport_->DeRegisterPacketFeedbackObserver(this); - channel_send_->ResetSenderCongestionControlObjects(); - } + rtp_transport_->DeRegisterPacketFeedbackObserver(this); + channel_send_->ResetSenderCongestionControlObjects(); // Blocking call to synchronize state with worker queue to ensure that there // are no pending tasks left that keeps references to audio. rtc::Event thread_sync_event; @@ -323,19 +318,15 @@ void AudioSendStream::ConfigureStream( // Probing in application limited region is only used in combination with // send side congestion control, wich depends on feedback packets which // requires transport sequence numbers to be enabled. - if (rtp_transport_) { - // Optionally request ALR probing but do not override any existing - // request from other streams. - if (enable_audio_alr_probing_) { - rtp_transport_->EnablePeriodicAlrProbing(true); - } - bandwidth_observer = rtp_transport_->GetBandwidthObserver(); + // Optionally request ALR probing but do not override any existing + // request from other streams. + if (enable_audio_alr_probing_) { + rtp_transport_->EnablePeriodicAlrProbing(true); } + bandwidth_observer = rtp_transport_->GetBandwidthObserver(); } - if (rtp_transport_) { - channel_send_->RegisterSenderCongestionControlObjects(rtp_transport_, - bandwidth_observer); - } + channel_send_->RegisterSenderCongestionControlObjects(rtp_transport_, + bandwidth_observer); } config_cs_.Enter(); // MID RTP header extension.