Skip to content

Commit

Permalink
fix(stats): Fix local stats when ssrc-rewriting is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
jallamsetty1 committed Apr 26, 2024
1 parent 2e2189f commit 7a5381f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,6 @@ TraceablePeerConnection.prototype.getTargetVideoBitrates = function() {
* @return {JitsiTrack|null}
*/
TraceablePeerConnection.prototype.getTrackBySSRC = function(ssrc) {
if (FeatureFlags.isSsrcRewritingSupported()) {
return this.remoteTracksBySsrc.get(ssrc);
}

if (typeof ssrc !== 'number') {
throw new Error(`SSRC ${ssrc} is not a number`);
}
Expand All @@ -825,6 +821,11 @@ TraceablePeerConnection.prototype.getTrackBySSRC = function(ssrc) {
return localTrack;
}
}

if (FeatureFlags.isSsrcRewritingSupported()) {
return this.remoteTracksBySsrc.get(ssrc);
}

for (const remoteTrack of this.getRemoteTracks()) {
if (remoteTrack.getSSRC() === ssrc) {
return remoteTrack;
Expand Down

0 comments on commit 7a5381f

Please sign in to comment.