mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Fixed generated application SDP entry with libnice
This commit is contained in:
@ -228,6 +228,7 @@ public:
|
||||
int addApplication(string mid = "data");
|
||||
int addVideo(string mid = "video", Direction dir = Direction::SendOnly);
|
||||
int addAudio(string mid = "audio", Direction dir = Direction::SendOnly);
|
||||
void clearMedia();
|
||||
|
||||
variant<Media *, Application *> media(unsigned int index);
|
||||
variant<const Media *, const Application *> media(unsigned int index) const;
|
||||
|
@ -426,6 +426,11 @@ int Description::addAudio(string mid, Direction dir) {
|
||||
return addMedia(Audio(std::move(mid), dir));
|
||||
}
|
||||
|
||||
void Description::clearMedia() {
|
||||
mEntries.clear();
|
||||
mApplication.reset();
|
||||
}
|
||||
|
||||
variant<Description::Media *, Description::Application *> Description::media(unsigned int index) {
|
||||
if (index >= mEntries.size())
|
||||
throw std::out_of_range("Media index out of range");
|
||||
|
@ -732,6 +732,9 @@ void PeerConnection::processLocalDescription(Description description) {
|
||||
const size_t localSctpPort = DEFAULT_SCTP_PORT;
|
||||
const size_t localMaxMessageSize = config.maxMessageSize.value_or(DEFAULT_LOCAL_MAX_MESSAGE_SIZE);
|
||||
|
||||
// Clean up the application entry the ICE transport might have added already (libnice)
|
||||
description.clearMedia();
|
||||
|
||||
if (auto remote = remoteDescription()) {
|
||||
// Reciprocate remote description
|
||||
for (unsigned int i = 0; i < remote->mediaCount(); ++i)
|
||||
|
Reference in New Issue
Block a user