Ver código fonte

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 anos atrás
pai
commit
f881b3c745
1 arquivos alterados com 4 adições e 9 exclusões
  1. 4
    9
      modules/xmpp/JingleSessionPC.js

+ 4
- 9
modules/xmpp/JingleSessionPC.js Ver arquivo

@@ -1868,8 +1868,6 @@ export default class JingleSessionPC extends JingleSession {
1868 1868
                     const mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
1869 1869
 
1870 1870
                     if (mid > -1) {
1871
-                        const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
1872
-
1873 1871
                         if (this.isP2P) {
1874 1872
                             // Do not remove ssrcs from m-line in p2p mode. If the ssrc is removed and added back to
1875 1873
                             // the same m-line (on source-add), Chrome/Safari do not render the media even if it is
@@ -1879,6 +1877,7 @@ export default class JingleSessionPC extends JingleSession {
1879 1877
                             // fire the "removetrack" event on the associated MediaStream. Also, the current direction
1880 1878
                             // of the transceiver for p2p will depend on whether a local sources is added or not. It
1881 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 1881
                             const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
1883 1882
 
1884 1883
                             [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
@@ -1886,14 +1885,10 @@ export default class JingleSessionPC extends JingleSession {
1886 1885
                                     .replace(`a=${direction}`, `a=${desiredDirection}`);
1887 1886
                             });
1888 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 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
                 });

Carregando…
Cancelar
Salvar