mirror of
https://github.com/koush/scrypted.git
synced 2026-03-20 16:40:24 +00:00
rebroadcast: Fix audio codec parsing bug
This commit is contained in:
@@ -218,26 +218,11 @@ const artpmap = 'a=rtpmap:';
|
||||
export function parseMSection(msection: string[]) {
|
||||
const control = msection.find(line => line.startsWith(acontrol))?.substring(acontrol.length);
|
||||
const mline = parseMLine(msection[0]);
|
||||
|
||||
const rtpmaps = msection.filter(line => line.startsWith(artpmap)).map(line => parseRtpMap(mline.type, line));
|
||||
|
||||
let codec: string;
|
||||
const [rtpmapFirst] = rtpmaps;
|
||||
if (rtpmapFirst) {
|
||||
codec = rtpmapFirst.codec;
|
||||
}
|
||||
else {
|
||||
// just guess
|
||||
const [firstPayloadType ] = mline.payloadTypes;
|
||||
if (firstPayloadType === 0)
|
||||
codec = 'pcm_ulaw';
|
||||
else if (firstPayloadType === 8)
|
||||
codec = 'pcm_alaw';
|
||||
else
|
||||
codec = 'pcm_alaw';
|
||||
}
|
||||
|
||||
const rawRtpmaps = msection.filter(line => line.startsWith(artpmap));
|
||||
const rtpmaps = rawRtpmaps.map(line => parseRtpMap(mline.type, line));
|
||||
const codec = parseRtpMap(mline.type, rawRtpmaps[0]).codec;
|
||||
let direction: string;
|
||||
|
||||
for (const checkDirection of ['sendonly', 'sendrecv', 'recvonly', 'inactive']) {
|
||||
const found = msection.find(line => line === 'a=' + checkDirection);
|
||||
if (found) {
|
||||
|
||||
4
plugins/prebuffer-mixin/package-lock.json
generated
4
plugins/prebuffer-mixin/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.85",
|
||||
"version": "0.9.86",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.85",
|
||||
"version": "0.9.86",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.85",
|
||||
"version": "0.9.86",
|
||||
"description": "Video Stream Rebroadcast, Prebuffer, and Management Plugin for Scrypted.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Reference in New Issue
Block a user