mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-20 23:32:22 +08:00
支持生成 sdp 时指定端口 (#1161)
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user