Skip to content

Commit

Permalink
fix(ssrc-rewriting): Check if track exists before updating owner/sour…
Browse files Browse the repository at this point in the history
…ceName.

Fixes missing audio issue when the bridge resends the full audio map even before the track for the SSRCs signaled before are created. This is possible when the RTP packets race with the thread that completed the websocket connection.
  • Loading branch information
jallamsetty1 committed Apr 30, 2024
1 parent 16b28a7 commit 58a9144
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/xmpp/JingleSessionPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,9 @@ export default class JingleSessionPC extends JingleSession {
} else {
const track = this.peerconnection.getTrackBySSRC(ssrc);

if (track.getParticipantId() === owner && track.getSourceName() === source) {
if (!track || (track.getParticipantId() === owner && track.getSourceName() === source)) {
!track && logger.warn(`Remote track for SSRC=${ssrc} hasn't been created yet,`
+ 'not processing the source map');
continue; // eslint-disable-line no-continue
}
logger.debug(`Existing SSRC re-mapped ${ssrc}: new owner=${owner}, source-name=${source}`);
Expand Down

0 comments on commit 58a9144

Please sign in to comment.