Ensure one does not register same rtp header extension with different id
Added assert to RtpHeaderExtensionMap Altered tests that did. BUG=webrtc:1994 Review-Url: https://codereview.webrtc.org/2462663002 Cr-Commit-Position: refs/heads/master@{#14840}
This commit is contained in:
@ -10,12 +10,15 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
constexpr uint8_t RtpHeaderExtensionMap::kInvalidId;
|
||||
|
||||
RtpHeaderExtensionMap::RtpHeaderExtensionMap() {
|
||||
}
|
||||
|
||||
@ -48,6 +51,7 @@ int32_t RtpHeaderExtensionMap::Register(RTPExtensionType type, uint8_t id) {
|
||||
// so return success.
|
||||
return 0;
|
||||
}
|
||||
RTC_DCHECK_EQ(kInvalidId, GetId(type));
|
||||
extensionMap_[id] = new HeaderExtension(type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user