Android WebRTC崩溃

Har*_*ary 3 android webrtc

我试图通过按后退按钮断开呼叫,应用程序崩溃与此错误.我在eclipse上使用Pierre Chabardes的AndroidRTC应用程序. https://github.com/pchab/AndroidRTC

我还通过linux机器构建了最新的WebRTC libjingle_peerconnection_so.solibjingle_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 
Run Code Online (Sandbox Code Playgroud)

Har*_*ary 5

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

它有类似的东西:

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

它需要通过这种方式接近:

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();
}
Run Code Online (Sandbox Code Playgroud)