Skip to content
Snippets Groups Projects
Unverified Commit b9dcdbcb authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #337 from trilene/master

Mitigate webrtc race condition
parents 45e91a7e 9a8a584f
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,12 @@
#include <QQuickItem>
#include <algorithm>
#include <cctype>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <optional>
#include <string_view>
#include <thread>
#include <utility>
#include "ChatPage.h"
......@@ -855,6 +857,9 @@ WebRTCSession::acceptOffer(const std::string &sdp)
return false;
}
// avoid a race that sometimes leaves the generated answer without media tracks (a=ssrc lines)
std::this_thread::sleep_for(std::chrono::milliseconds(200));
// set-remote-description first, then create-answer
GstPromise *promise = gst_promise_new_with_change_func(createAnswer, webrtc_, nullptr);
g_signal_emit_by_name(webrtc_, "set-remote-description", offer, promise);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment