Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit

This commit is contained in:
ziyue 2021-10-15 14:12:41 +08:00
commit a408197493
3 changed files with 5 additions and 4 deletions

View File

@ -454,6 +454,7 @@ std::shared_ptr<RtcpSdes> RtcpSdes::create(const std::vector<string> &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());

View File

@ -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";

View File

@ -216,7 +216,7 @@ public:
map<char, string> _other;
multimap<string, string> _attr;
string toString() const;
string toString(uint16_t port = 0) const;
string getName() const;
string getControlUrl(const string &base_url) const;