修复rtp ext解析相关bug

This commit is contained in:
xiongziliang 2021-10-06 22:10:54 +08:00
parent b62bd910a2
commit fc5b09365e
2 changed files with 3 additions and 3 deletions

View File

@ -162,9 +162,9 @@ size_t RtpExt::size() const {
return _size; return _size;
} }
const char& RtpExt::operator[](size_t pos) const{ const uint8_t& RtpExt::operator[](size_t pos) const{
CHECK(pos < _size); CHECK(pos < _size);
return _data[pos]; return ((uint8_t*)_data)[pos];
} }
RtpExt::operator std::string() const{ RtpExt::operator std::string() const{

View File

@ -99,7 +99,7 @@ private:
RtpExt(void *ptr, bool one_byte_ext, const char *str, size_t size); RtpExt(void *ptr, bool one_byte_ext, const char *str, size_t size);
const char *data() const; const char *data() const;
size_t size() const; size_t size() const;
const char& operator[](size_t pos) const; const uint8_t& operator[](size_t pos) const;
operator std::string() const; operator std::string() const;
private: private: