mirror of
https://github.com/koush/scrypted.git
synced 2026-02-12 01:54:27 +00:00
rebroadcast: fix stream filtering
This commit is contained in:
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.1.258",
|
||||
"version": "0.1.259",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.1.258",
|
||||
"version": "0.1.259",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.1.258",
|
||||
"version": "0.1.259",
|
||||
"description": "Rebroadcast and Prebuffer for VideoCameras.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1120,7 +1120,11 @@ class PrebufferSession {
|
||||
|
||||
if (container === 'rtsp') {
|
||||
const parsedSdp = parseSdp(sdp);
|
||||
parsedSdp.msections = parsedSdp.msections.filter(msection => msection.codec === mediaStreamOptions.video?.codec || msection.codec === mediaStreamOptions.audio?.codec);
|
||||
const videoSection = parsedSdp.msections.find(msection => msection.codec && msection.codec === mediaStreamOptions.video?.codec) || parsedSdp.msections.find(msection => msection.type === 'video');
|
||||
let audioSection = parsedSdp.msections.find(msection => msection.codec && msection.codec === mediaStreamOptions.audio?.codec) || parsedSdp.msections.find(msection => msection.type === 'audio');
|
||||
if (mediaStreamOptions.audio === null)
|
||||
audioSection = undefined;
|
||||
parsedSdp.msections = parsedSdp.msections.filter(msection => msection === videoSection || msection === audioSection);
|
||||
const filterPrebufferAudio = options?.prebuffer === undefined;
|
||||
const videoCodec = parsedSdp.msections.find(msection => msection.type === 'video')?.codec;
|
||||
sdp = parsedSdp.toSdp();
|
||||
|
||||
Reference in New Issue
Block a user