From 2a2597a87441e3fcd6e5a0ff860ef710fe2e5617 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang <1237906+wasphin@users.noreply.github.com> Date: Fri, 15 Oct 2021 14:09:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=86=85?= =?UTF-8?q?=E5=AD=98=20(#1162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtcp/Rtcp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Rtcp/Rtcp.cpp b/src/Rtcp/Rtcp.cpp index 027fabc7..707e08e4 100644 --- a/src/Rtcp/Rtcp.cpp +++ b/src/Rtcp/Rtcp.cpp @@ -454,6 +454,7 @@ std::shared_ptr RtcpSdes::create(const std::vector &item_text) auto real_size = sizeof(RtcpSdes) - sizeof(SdesChunk) + item_total_size; auto bytes = alignSize(real_size); auto ptr = (RtcpSdes *) new char[bytes]; + memset(ptr, 0x00, bytes); auto item_ptr = &ptr->chunks; for (auto &text : item_text) { item_ptr->txt_len = (0xFF & text.size()); From fe450ba2cb93c44b8ec5a9fede5eae82838e1b1d Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang <1237906+wasphin@users.noreply.github.com> Date: Fri, 15 Oct 2021 14:10:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90=20sdp?= =?UTF-8?q?=20=E6=97=B6=E6=8C=87=E5=AE=9A=E7=AB=AF=E5=8F=A3=20(#1161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 6 +++--- src/Rtsp/Rtsp.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 693f87a9..01825fa5 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -94,7 +94,7 @@ string SdpTrack::getControlUrl(const string &base_url) const { return base_url + "/" + _control; } -string SdpTrack::toString() const { +string SdpTrack::toString(uint16_t port) const { _StrPrinter _printer; switch (_type) { case TrackTitle: { @@ -106,9 +106,9 @@ string SdpTrack::toString() const { case TrackAudio: case TrackVideo: { if (_type == TrackAudio) { - _printer << "m=audio 0 RTP/AVP " << _pt << "\r\n"; + _printer << "m=audio " << port << " RTP/AVP " << _pt << "\r\n"; } else { - _printer << "m=video 0 RTP/AVP " << _pt << "\r\n"; + _printer << "m=video " << port << " RTP/AVP " << _pt << "\r\n"; } if (!_b.empty()) { _printer << "b=" << _b << "\r\n"; diff --git a/src/Rtsp/Rtsp.h b/src/Rtsp/Rtsp.h index 93713b0b..6b201b20 100644 --- a/src/Rtsp/Rtsp.h +++ b/src/Rtsp/Rtsp.h @@ -216,7 +216,7 @@ public: map _other; multimap _attr; - string toString() const; + string toString(uint16_t port = 0) const; string getName() const; string getControlUrl(const string &base_url) const;