From 8644d056366b2e245aa0f53c1625a6e492ca88f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 19 Dec 2024 10:39:42 +0100 Subject: [PATCH] Move attributes to local variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../talk/webrtc/PeerConnectionWrapper.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java index 8929af1c0..70d59e11f 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java @@ -62,9 +62,6 @@ public class PeerConnectionWrapper { private final List pendingDataChannelMessages = new ArrayList<>(); private final SdpObserver sdpObserver; - private final boolean hasInitiated; - - private final MediaStream localStream; private final boolean isMCUPublisher; private final String videoStreamType; @@ -113,14 +110,13 @@ public class PeerConnectionWrapper { boolean isMCUPublisher, boolean hasMCU, String videoStreamType, SignalingMessageReceiver signalingMessageReceiver, SignalingMessageSender signalingMessageSender) { - this.localStream = localStream; this.videoStreamType = videoStreamType; this.sessionId = sessionId; this.mediaConstraints = mediaConstraints; sdpObserver = new SdpObserver(); - hasInitiated = sessionId.compareTo(localSession) < 0; + boolean hasInitiated = sessionId.compareTo(localSession) < 0; this.isMCUPublisher = isMCUPublisher; PeerConnection.RTCConfiguration configuration = new PeerConnection.RTCConfiguration(iceServerList); @@ -133,12 +129,12 @@ public class PeerConnectionWrapper { this.signalingMessageSender = signalingMessageSender; if (peerConnection != null) { - if (this.localStream != null) { - List localStreamIds = Collections.singletonList(this.localStream.getId()); - for(AudioTrack track : this.localStream.audioTracks) { + if (localStream != null) { + List localStreamIds = Collections.singletonList(localStream.getId()); + for(AudioTrack track : localStream.audioTracks) { peerConnection.addTrack(track, localStreamIds); } - for(VideoTrack track : this.localStream.videoTracks) { + for(VideoTrack track : localStream.videoTracks) { peerConnection.addTrack(track, localStreamIds); } }