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] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90=20sdp=20?= =?UTF-8?q?=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;