webrtc: fix audio handling on unrecognized codec

This commit is contained in:
Koushik Dutta
2024-04-13 09:43:34 -07:00
parent c1c9fec62f
commit 9c0d253cae
3 changed files with 4 additions and 4 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/webrtc",
"version": "0.2.22",
"version": "0.2.23",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/webrtc",
"version": "0.2.22",
"version": "0.2.23",
"dependencies": {
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/webrtc",
"version": "0.2.22",
"version": "0.2.23",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",
"prescrypted-setup-project": "scrypted-package-json",

View File

@@ -204,7 +204,7 @@ export async function startRtpForwarderProcess(console: Console, ffmpegInput: FF
}
const audioSections = parsedSdp.msections.filter(msection => msection.type === 'audio');
let audioSection = audioSections.find(msection => msection.codec === audioCodec || audioCodec === 'copy');
let audioSection = audioSections.find(msection => (msection.codec && msection.codec === audioCodec) || audioCodec === 'copy');
if (!audioSection) {
for (const check of audioSections) {
if (await audio?.negotiate?.(check) === true) {