From 5856ad60dd3ebee3422dbd196914217c5ea1f6fd Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 10 Oct 2024 10:48:40 -0700 Subject: [PATCH] webrtc: fix opus crash --- plugins/webrtc/package-lock.json | 4 ++-- plugins/webrtc/package.json | 2 +- plugins/webrtc/src/main.ts | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/webrtc/package-lock.json b/plugins/webrtc/package-lock.json index e54c00ea0..fef2433c0 100644 --- a/plugins/webrtc/package-lock.json +++ b/plugins/webrtc/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/webrtc", - "version": "0.2.54", + "version": "0.2.55", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/webrtc", - "version": "0.2.54", + "version": "0.2.55", "dependencies": { "@scrypted/common": "file:../../common", "@scrypted/sdk": "file:../../sdk", diff --git a/plugins/webrtc/package.json b/plugins/webrtc/package.json index ab43f68cf..71894c3a6 100644 --- a/plugins/webrtc/package.json +++ b/plugins/webrtc/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/webrtc", - "version": "0.2.54", + "version": "0.2.55", "scripts": { "scrypted-setup-project": "scrypted-setup-project", "prescrypted-setup-project": "scrypted-package-json", diff --git a/plugins/webrtc/src/main.ts b/plugins/webrtc/src/main.ts index 7d3a33495..75b86f093 100644 --- a/plugins/webrtc/src/main.ts +++ b/plugins/webrtc/src/main.ts @@ -347,6 +347,7 @@ export class WebRTCPlugin extends AutoenableMixinProvider implements DeviceCreat try { const { createConnection } = await result.result; connection = await createConnection({}, undefined, session, + this.storageSettings.values.requireOpus, maximumCompatibilityMode, clientOptions, { @@ -624,6 +625,7 @@ export async function fork() { async createConnection(message: any, port: number, clientSession: RTCSignalingSession, + requireOpus, maximumCompatibilityMode: boolean, clientOptions: RTCSignalingOptions, options: { @@ -668,7 +670,7 @@ export async function fork() { const cleanup = new Deferred(); cleanup.promise.catch(e => this.console.log('cleaning up rtc connection:', e.message)); - const connection = new WebRTCConnectionManagement(console, clientSession, this.storageSettings.values.requireOpus, maximumCompatibilityMode, clientOptions, options); + const connection = new WebRTCConnectionManagement(console, clientSession, requireOpus, maximumCompatibilityMode, clientOptions, options); cleanup.promise.finally(() => connection.close().catch(() => { })); const { pc } = connection; waitClosed(pc).then(() => cleanup.resolve('peer connection closed'));