From a3ae813d05718c0f41c2c2b403f664d31bf37032 Mon Sep 17 00:00:00 2001 From: kourtney Date: Wed, 17 Jan 2024 17:57:00 +0800 Subject: [PATCH] Fixes mozilla/dialog#53 --- index.js | 1 + lib/Room.js | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 641a86e9..54a9310b 100644 --- a/index.js +++ b/index.js @@ -93,6 +93,7 @@ async function runMediasoupWorkers() rtcMinPort : Number(config.mediasoup.workerSettings.rtcMinPort), rtcMaxPort : Number(config.mediasoup.workerSettings.rtcMaxPort) }); + worker._pid = i; worker.on('died', () => { diff --git a/lib/Room.js b/lib/Room.js index a30e7fc7..9a9f1d36 100644 --- a/lib/Room.js +++ b/lib/Room.js @@ -1488,15 +1488,14 @@ class Room extends EventEmitter for (const peer of peersToPipe) { const srcRouter = this._mediasoupRouters.get(peer.data.routerId); + if (routerId === peer.data.routerId) + { + logger.info("~~~skipping~parenting~router~~~") + continue; + } for (const producerId of peer.data.producers.keys()) { - if (router._producers.has(producerId)) - { - logger.info("~~~skipping~parenting~router~~~") - continue; - } - await srcRouter.pipeToRouter({ producerId : producerId, router : router