webrtc: fix opus crash

This commit is contained in:
Koushik Dutta
2024-10-10 10:48:40 -07:00
parent 124da3c1b7
commit 5856ad60dd
3 changed files with 6 additions and 4 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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<string>();
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'));