diff --git a/examples/peerconnection/client/conductor.cc b/examples/peerconnection/client/conductor.cc index 005a9d6ddf..744c6b1826 100644 --- a/examples/peerconnection/client/conductor.cc +++ b/examples/peerconnection/client/conductor.cc @@ -130,9 +130,13 @@ bool Conductor::InitializePeerConnection() { RTC_DCHECK(!peer_connection_factory_); RTC_DCHECK(!peer_connection_); + if (!signaling_thread_.get()) { + signaling_thread_ = rtc::Thread::CreateWithSocketServer(); + signaling_thread_->Start(); + } peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( nullptr /* network_thread */, nullptr /* worker_thread */, - nullptr /* signaling_thread */, nullptr /* default_adm */, + signaling_thread_.get(), nullptr /* default_adm */, webrtc::CreateBuiltinAudioEncoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinVideoEncoderFactory(), diff --git a/examples/peerconnection/client/conductor.h b/examples/peerconnection/client/conductor.h index 3c06857a05..332cd43d3a 100644 --- a/examples/peerconnection/client/conductor.h +++ b/examples/peerconnection/client/conductor.h @@ -21,6 +21,7 @@ #include "api/peer_connection_interface.h" #include "examples/peerconnection/client/main_wnd.h" #include "examples/peerconnection/client/peer_connection_client.h" +#include "rtc_base/thread.h" namespace webrtc { class VideoCaptureModule; @@ -122,6 +123,7 @@ class Conductor : public webrtc::PeerConnectionObserver, int peer_id_; bool loopback_; + std::unique_ptr signaling_thread_; rtc::scoped_refptr peer_connection_; rtc::scoped_refptr peer_connection_factory_;