| Index: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
|
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
|
| index 3d2aad42a0160170b3e6be6cfe55dc05834bb213..1023bf8bb20ce05af91433c78decd931c3bcc55a 100644
|
| --- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
|
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
|
| @@ -121,12 +121,17 @@ RTPPayloadRegistry::~RTPPayloadRegistry() = default;
|
|
|
| int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec,
|
| bool* created_new_payload) {
|
| + rtc::CritScope cs(&crit_sect_);
|
| +
|
| +#if RTC_DCHECK_IS_ON
|
| + RTC_DCHECK(!used_for_video_);
|
| + used_for_audio_ = true;
|
| +#endif
|
| +
|
| *created_new_payload = false;
|
| if (!IsPayloadTypeValid(audio_codec.pltype))
|
| return -1;
|
|
|
| - rtc::CritScope cs(&crit_sect_);
|
| -
|
| auto it = payload_type_map_.find(audio_codec.pltype);
|
| if (it != payload_type_map_.end()) {
|
| // We already use this payload type. Check if it's the same as we already
|
| @@ -154,11 +159,16 @@ int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec,
|
|
|
| int32_t RTPPayloadRegistry::RegisterReceivePayload(
|
| const VideoCodec& video_codec) {
|
| + rtc::CritScope cs(&crit_sect_);
|
| +
|
| +#if RTC_DCHECK_IS_ON
|
| + RTC_DCHECK(!used_for_audio_);
|
| + used_for_video_ = true;
|
| +#endif
|
| +
|
| if (!IsPayloadTypeValid(video_codec.plType))
|
| return -1;
|
|
|
| - rtc::CritScope cs(&crit_sect_);
|
| -
|
| auto it = payload_type_map_.find(video_codec.plType);
|
| if (it != payload_type_map_.end()) {
|
| // We already use this payload type. Check if it's the same as we already
|
|
|