Browse Source

fix(stats): Fix local stats when ssrc-rewriting is enabled.

release-8443
Jaya Allamsetty 1 year ago
parent
commit
7a5381fb46
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      modules/RTC/TraceablePeerConnection.js

+ 5
- 4
modules/RTC/TraceablePeerConnection.js View File

813
  * @return {JitsiTrack|null}
813
  * @return {JitsiTrack|null}
814
  */
814
  */
815
 TraceablePeerConnection.prototype.getTrackBySSRC = function(ssrc) {
815
 TraceablePeerConnection.prototype.getTrackBySSRC = function(ssrc) {
816
-    if (FeatureFlags.isSsrcRewritingSupported()) {
817
-        return this.remoteTracksBySsrc.get(ssrc);
818
-    }
819
-
820
     if (typeof ssrc !== 'number') {
816
     if (typeof ssrc !== 'number') {
821
         throw new Error(`SSRC ${ssrc} is not a number`);
817
         throw new Error(`SSRC ${ssrc} is not a number`);
822
     }
818
     }
825
             return localTrack;
821
             return localTrack;
826
         }
822
         }
827
     }
823
     }
824
+
825
+    if (FeatureFlags.isSsrcRewritingSupported()) {
826
+        return this.remoteTracksBySsrc.get(ssrc);
827
+    }
828
+
828
     for (const remoteTrack of this.getRemoteTracks()) {
829
     for (const remoteTrack of this.getRemoteTracks()) {
829
         if (remoteTrack.getSSRC() === ssrc) {
830
         if (remoteTrack.getSSRC() === ssrc) {
830
             return remoteTrack;
831
             return remoteTrack;

Loading…
Cancel
Save