Check failed: current_thread->IsInvokeToThreadAllowed(this) Fatal error in: ../../rtc_base/thread.c

Fatal error in: …/…/rtc_base/thread.cc, line 950

last system error: 0

Check failed: current_thread->IsInvokeToThreadAllowed(this)

webrtc有三大线程,线程之间的并不能随便调用,也就是不同的函数工作在不同的线程中,因此在使用C++api或者改动源码时一定要注意,不同的函数里不能随意调用其他的接口api,可能会报这个错误。笔者是在推流断网重连后,在以下函数中调用了拉流的代码报出的以上错误。

  void OnIceConnectionChange(
      webrtc::PeerConnectionInterface::IceConnectionState new_state) override
  {
   
    
    
    

猜你喜欢

转载自blog.csdn.net/weixin_43466192/article/details/130409156