소스 검색

fix(JingleSessionPC) Do not recycle m-lines when sources leave and join.

Recycling the m-line by rejecting it and then re-using is causing issues where sometimes the track addition fails. When a new ssrc is added to an m-line that was rejected and port is changed back to the default port, sometimes the remote sdp returned by browser wouldn't contain the newly added ssrcs and the track addition fails as a result.
Error: No SSRC lines found in remote SDP for remote stream[msid=854882f8-audio-1,type=audio]
    at Ca._remoteTrackAdded (https://web-cdn.jitsi.net/meetjitsi_5885.2601/libs/lib-jitsi-meet.min.js?v=5885.2601:2:439103)
    at Ca._usesUnifiedPlan.onTrack (https://web-cdn.jitsi.net/meetjitsi_5885.2601/libs/lib-jitsi-meet.min.js?v=5885.2601:2:432207)
    at RTCPeerConnection.r (https://web-cdn.jitsi.net/meetjitsi_5885.2601/libs/lib-jitsi-meet.min.js?v=5885.2601:2:680736)
.
dev1
Jaya Allamsetty 3 년 전
부모
커밋
f881b3c745
1개의 변경된 파일4개의 추가작업 그리고 9개의 파일을 삭제
  1. 4
    9
      modules/xmpp/JingleSessionPC.js

+ 4
- 9
modules/xmpp/JingleSessionPC.js 파일 보기

1868
                     const mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
1868
                     const mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
1869
 
1869
 
1870
                     if (mid > -1) {
1870
                     if (mid > -1) {
1871
-                        const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
1872
-
1873
                         if (this.isP2P) {
1871
                         if (this.isP2P) {
1874
                             // Do not remove ssrcs from m-line in p2p mode. If the ssrc is removed and added back to
1872
                             // Do not remove ssrcs from m-line in p2p mode. If the ssrc is removed and added back to
1875
                             // the same m-line (on source-add), Chrome/Safari do not render the media even if it is
1873
                             // the same m-line (on source-add), Chrome/Safari do not render the media even if it is
1879
                             // fire the "removetrack" event on the associated MediaStream. Also, the current direction
1877
                             // fire the "removetrack" event on the associated MediaStream. Also, the current direction
1880
                             // of the transceiver for p2p will depend on whether a local sources is added or not. It
1878
                             // of the transceiver for p2p will depend on whether a local sources is added or not. It
1881
                             // will be 'sendrecv' if the local source is present, 'sendonly' otherwise.
1879
                             // will be 'sendrecv' if the local source is present, 'sendonly' otherwise.
1880
+                            const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
1882
                             const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
1881
                             const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
1883
 
1882
 
1884
                             [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
1883
                             [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
1886
                                     .replace(`a=${direction}`, `a=${desiredDirection}`);
1885
                                     .replace(`a=${direction}`, `a=${desiredDirection}`);
1887
                             });
1886
                             });
1888
                         } else {
1887
                         } else {
1889
-                            // Change the port to 0 to reject the m-line associated with the source. The rejected
1890
-                            // m-lines are recycled when new ssrcs need to be added to the remote description.
1891
-                            const port = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.port;
1892
-
1888
+                            // Jvb connections will have direction set to 'sendonly' for the remote sources.
1893
                             remoteSdp.media[mid] = remoteSdp.media[mid].replace(`${line}\r\n`, '');
1889
                             remoteSdp.media[mid] = remoteSdp.media[mid].replace(`${line}\r\n`, '');
1894
-                            remoteSdp.media[mid] = remoteSdp.media[mid].replace(
1895
-                                `m=${mediaType} ${port}`,
1896
-                                `m=${mediaType} 0`);
1890
+                            remoteSdp.media[mid] = remoteSdp.media[mid]
1891
+                                .replace(`a=${MediaDirection.SENDONLY}`, `a=${MediaDirection.INACTIVE}`);
1897
                         }
1892
                         }
1898
                     }
1893
                     }
1899
                 });
1894
                 });

Loading…
취소
저장