Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc

Issue 2763323002: DCHECK that no RTPPayloadRegistry instance is used for both audio and video (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..55d167879ba5e3cfff82fb704cc9a05e29b8a173 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
@@ -121,6 +121,11 @@ RTPPayloadRegistry::~RTPPayloadRegistry() = default;
int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec,
bool* created_new_payload) {
+#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;
@@ -154,6 +159,11 @@ int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec,
int32_t RTPPayloadRegistry::RegisterReceivePayload(
const VideoCodec& video_codec) {
+#if RTC_DCHECK_IS_ON
+ RTC_DCHECK(!used_for_audio_);
+ used_for_video_ = true;
+#endif
+
if (!IsPayloadTypeValid(video_codec.plType))
return -1;
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698