浏览代码

Close localStream after peerConnection

The peerConnection get passed the tracks of the localStream. So to make
sure that the tracks are not released before the connection is closed it
will now done after closing the peerConnection.

Signed-off-by: Tim Krüger <t@timkrueger.me>
Tim Krüger 3 年之前
父节点
当前提交
3d76ba3571
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

+ 9 - 7
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -1608,13 +1608,7 @@ public class CallActivity extends CallBaseActivity {
                 peerConnectionFactory = null;
             }
 
-            if(localStream != null) {
-                localStream.dispose();
-                localStream = null;
-                Log.d(TAG, "Disposed localStream");
-            } else {
-                Log.d(TAG, "localStream is null");
-            }
+
             localAudioTrack = null;
             localVideoTrack = null;
 
@@ -1628,6 +1622,14 @@ public class CallActivity extends CallBaseActivity {
             endPeerConnection(peerConnectionWrapperList.get(i).getSessionId(), false);
         }
 
+        if(localStream != null) {
+            localStream.dispose();
+            localStream = null;
+            Log.d(TAG, "Disposed localStream");
+        } else {
+            Log.d(TAG, "localStream is null");
+        }
+
         hangupNetworkCalls(shutDownView);
         ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
     }