@@ -744,12 +744,14 @@ class CreateSessionDescriptionObserverOperationWrapper
744
744
RTC_DCHECK (observer_);
745
745
}
746
746
~CreateSessionDescriptionObserverOperationWrapper () override {
747
+ #if RTC_DCHECK_IS_ON
747
748
RTC_DCHECK (was_called_);
749
+ #endif
748
750
}
749
751
750
752
void OnSuccess (SessionDescriptionInterface* desc) override {
753
+ #if RTC_DCHECK_IS_ON
751
754
RTC_DCHECK (!was_called_);
752
- #ifdef RTC_DCHECK_IS_ON
753
755
was_called_ = true ;
754
756
#endif // RTC_DCHECK_IS_ON
755
757
// Completing the operation before invoking the observer allows the observer
@@ -759,16 +761,16 @@ class CreateSessionDescriptionObserverOperationWrapper
759
761
}
760
762
761
763
void OnFailure (RTCError error) override {
764
+ #if RTC_DCHECK_IS_ON
762
765
RTC_DCHECK (!was_called_);
763
- #ifdef RTC_DCHECK_IS_ON
764
766
was_called_ = true ;
765
767
#endif // RTC_DCHECK_IS_ON
766
768
operation_complete_callback_ ();
767
769
observer_->OnFailure (std::move (error));
768
770
}
769
771
770
772
private:
771
- #ifdef RTC_DCHECK_IS_ON
773
+ #if RTC_DCHECK_IS_ON
772
774
bool was_called_ = false ;
773
775
#endif // RTC_DCHECK_IS_ON
774
776
rtc::scoped_refptr<CreateSessionDescriptionObserver> observer_;
@@ -2919,6 +2921,7 @@ SdpOfferAnswerHandler::AssociateTransceiver(
2919
2921
const ContentInfo* old_local_content,
2920
2922
const ContentInfo* old_remote_content) {
2921
2923
RTC_DCHECK (IsUnifiedPlan ());
2924
+ #if RTC_DCHECK_IS_ON
2922
2925
// If this is an offer then the m= section might be recycled. If the m=
2923
2926
// section is being recycled (defined as: rejected in the current local or
2924
2927
// remote description and not rejected in new description), the transceiver
@@ -2933,6 +2936,8 @@ SdpOfferAnswerHandler::AssociateTransceiver(
2933
2936
// The transceiver should be disassociated in RemoveStoppedTransceivers()
2934
2937
RTC_DCHECK (!old_transceiver);
2935
2938
}
2939
+ #endif
2940
+
2936
2941
const MediaContentDescription* media_desc = content.media_description ();
2937
2942
auto transceiver = transceivers ().FindByMid (content.name );
2938
2943
if (source == cricket::CS_LOCAL) {
@@ -2984,6 +2989,9 @@ SdpOfferAnswerHandler::AssociateTransceiver(
2984
2989
transceivers ().StableState (transceiver)->set_newly_created ();
2985
2990
}
2986
2991
}
2992
+
2993
+ RTC_DCHECK (transceiver);
2994
+
2987
2995
// Check if the offer indicated simulcast but the answer rejected it.
2988
2996
// This can happen when simulcast is not supported on the remote party.
2989
2997
if (SimulcastIsRejected (old_local_content, *media_desc)) {
@@ -2996,12 +3004,13 @@ SdpOfferAnswerHandler::AssociateTransceiver(
2996
3004
}
2997
3005
}
2998
3006
}
2999
- RTC_DCHECK (transceiver);
3007
+
3000
3008
if (transceiver->media_type () != media_desc->type ()) {
3001
3009
LOG_AND_RETURN_ERROR (
3002
3010
RTCErrorType::INVALID_PARAMETER,
3003
3011
" Transceiver type does not match media description type." );
3004
3012
}
3013
+
3005
3014
if (media_desc->HasSimulcast ()) {
3006
3015
std::vector<SimulcastLayer> layers =
3007
3016
source == cricket::CS_LOCAL
0 commit comments