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;