Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lastpeony committed Oct 8, 2024
1 parent aef95cf commit 72c7c85
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,11 @@ public boolean isStreaming(String streamId) {
public void onTakeConfiguration(String streamId, SessionDescription sdp) {
this.handler.post(() -> {
if (sdp.type == SessionDescription.Type.OFFER) {
PeerConnection pc = getPeerConnectionFor(streamId);
PeerInfo peerInfo = getPeerInfoFor(streamId);
PeerConnection pc = peerInfo.peerConnection;
if (pc == null) {
createPeerConnection(streamId, false);
boolean createLocalTrack = peerInfo.mode == Mode.P2P;
createPeerConnection(streamId, createLocalTrack);
}

setRemoteDescription(streamId, sdp);
Expand Down Expand Up @@ -2051,7 +2053,7 @@ public void createPeerConnectionInternal(String streamId, boolean createLocalTra

setWebRTCLogLevel();

if(createLocalTrack || peer.mode == Mode.P2P){
if(createLocalTrack){

List<String> mediaStreamLabels = Collections.singletonList("ARDAMS");
try{
Expand Down

0 comments on commit 72c7c85

Please sign in to comment.