Skip to content
Snippets Groups Projects
Commit a0df228d authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

media: improve media switching speed

Destroying an ice session take quite some time and must be done in
the io pool

Change-Id: I159d249927a3aecbff640143902c8a6d33a52282
parent 03ed9910
Branches
No related tags found
No related merge requests found
......@@ -1251,8 +1251,12 @@ SIPCall::waitForIceAndStartMedia()
// Nego succeed: move to the new media transport
call->stopAllMedia();
if (call->tmpMediaTransport_)
if (call->tmpMediaTransport_) {
// Destroy the ICE media transport on another thread. This can take quite some time.
if (call->mediaTransport_)
dht::ThreadPool::io().run([ice=std::make_shared<decltype(call->mediaTransport_)>(std::move(call->mediaTransport_))] { });
call->mediaTransport_ = std::move(call->tmpMediaTransport_);
}
call->startAllMedia();
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment