【问题标题】:Android WebRTC crashesAndroid WebRTC 崩溃
【发布时间】:2016-04-07 13:24:19
【问题描述】:

我试图通过按返回按钮来断开呼叫,应用程序因此错误而崩溃。我在 Eclipse 上使用 Pierre Chabardes 的 AndroidRTC 应用程序。 https://github.com/pchab/AndroidRTC

我还通过linux机器构建了最新的WebRTC libjingle_peerconnection_so.so & libjingle_peerconnection.jar

04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: E/rtc(29060): # Fatal error in ../../talk/app/webrtc/java/jni/peerconnection_jni.cc, line 926
04-10 12:20:16.695: E/rtc(29060): # Check failed: 0 == (reinterpret_cast<MediaSourceInterface*>(j_p))->Release() (0 vs. 1)
04-10 12:20:16.695: E/rtc(29060): # Unexpected refcount.
04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: A/libc(29060): Fatal signal 6 (SIGABRT), code -6 in tid 29060 

【问题讨论】:

  • @Haesh 您对此有什么解决方案吗?
  • 有什么消息吗?我在使用 WebRTC android 库时遇到了同样的问题
  • @ArfanMirza 请在下面查看我的答案。它可能会帮助你..
  • @tryp 在下面查看我的解决方案,它可能会对您有所帮助。

标签: android webrtc


【解决方案1】:

经过几个小时的测试,我发现最初创建的Socket在onDestroy()方法中没有正确关闭。

那里是这样的:

public void onDestroy() {
    for (Peer peer : peers.values()) {
        peer.pc.dispose();
    }
    videoSource.dispose();
    factory.dispose();
    client.disconnect();
    client.close();
}

它需要通过这种方式关闭:

public void onDestroy() {
    for (Peer peer : peers.values()) {
        peer.pc.dispose();
    }
    videoSource.dispose();
    factory.dispose();
    client.off();<---- You need to turn OFF and then disconnect  and then close it.
    client.disconnect();
    client.close();
}

【讨论】:

  • android 屏幕旋转后同样的问题
  • 你用的是什么libjingle的版本?我使用带有client.off() 的8981 版本,但它无法工作。
  • 嗨,Harse,我还是崩溃了,你能告诉我如何解决这个崩溃。这很紧急。请帮忙。
  • 嗨,谢谢,我用这个修复了崩溃问题,我评论 //videoSource.dispose();并添加 videoSource.stop();
  • 我在 diff 浏览器上登录 StackOverflow,只是为了支持这个答案。谢谢 Chaudhary saab .. ;)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-07
相关资源
最近更新 更多