Bläddra i källkod

Fixed the description of SDPs

sam 4 år sedan
förälder
incheckning
f83a03fcad
2 ändrade filer med 7 tillägg och 3 borttagningar
  1. 6 3
      include/rtc/rtp.hpp
  2. 1 0
      src/description.cpp

+ 6 - 3
include/rtc/rtp.hpp

@@ -690,6 +690,10 @@ public:
 		return totalSize - (getBody() - reinterpret_cast<char *>(this));
 	}
 
+	[[nodiscard]] size_t getSize()  const{
+		return header.getSize() + sizeof(uint16_t);
+	}
+
 	[[nodiscard]] RTP &getHeader() { return header; }
 
 	size_t normalizePacket(size_t totalSize, SSRC originalSSRC, uint8_t originalPayloadType) {
@@ -697,9 +701,8 @@ public:
 		header.setSsrc(originalSSRC);
 		header.setPayloadType(originalPayloadType);
 		// TODO, the -12 is the size of the header (which is variable!)
-		memmove(header.getBody(), header.getBody() + sizeof(uint16_t),
-		        totalSize - 12 - sizeof(uint16_t));
-		return totalSize - sizeof(uint16_t);
+		memmove(header.getBody(), getBody(), totalSize - getSize());
+		return totalSize - getSize();
 	}
 };
 

+ 1 - 0
src/description.cpp

@@ -839,6 +839,7 @@ void Description::Media::addRTPMap(const Description::Media::RTPMap &map) {
 }
 
 std::vector<uint32_t> Description::Media::getSSRCs() {
+	return mSsrcs;
 	std::vector<uint32_t> vec;
 	for (auto &val : mAttributes) {
 		PLOG_DEBUG << val;