mirror of
https://github.com/koush/scrypted.git
synced 2026-03-02 09:12:08 +00:00
rebroadcast: fix bug where packet length was parsed as signed integer.
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.170",
|
||||
"version": "0.1.171",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.1.170",
|
||||
"version": "0.1.171",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.1.170",
|
||||
"version": "0.1.171",
|
||||
"description": "Rebroadcast and Prebuffer for VideoCameras.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -7,7 +7,7 @@ import { handleRebroadcasterClient, ParserOptions, ParserSession, startParserSes
|
||||
import { createMpegTsParser, createFragmentedMp4Parser, StreamChunk, StreamParser } from '@scrypted/common/src/stream-parser';
|
||||
import { AutoenableMixinProvider } from '@scrypted/common/src/autoenable-mixin-provider';
|
||||
import { listenZeroSingleClient } from '@scrypted/common/src/listen-cluster';
|
||||
import { parsePayloadTypes } from '@scrypted/common/src/sdp-utils';
|
||||
import { parsePayloadTypes, parseTrackIds } from '@scrypted/common/src/sdp-utils';
|
||||
import { createRtspParser, RtspClient, RtspServer } from '@scrypted/common/src/rtsp-server';
|
||||
import { Duplex } from 'stream';
|
||||
import net from 'net';
|
||||
@@ -446,8 +446,10 @@ class PrebufferSession {
|
||||
const sdpResponse = await rtspClient.describe();
|
||||
const sdp = sdpResponse.body.toString().trim();
|
||||
this.sdp = Promise.resolve(sdp);
|
||||
await rtspClient.setup(0, '/audio');
|
||||
await rtspClient.setup(2, '/video');
|
||||
const { audio, video } = parseTrackIds(sdp);
|
||||
// handle no audio?
|
||||
await rtspClient.setup(0, audio);
|
||||
await rtspClient.setup(2, video);
|
||||
const socket = await rtspClient.play();
|
||||
session = await startRFC4571Parser(socket, sdp, ffmpegInput.mediaStreamOptions, true, rbo);
|
||||
}
|
||||
|
||||
@@ -70,11 +70,11 @@ export async function startRFC4571Parser(socket: net.Socket, sdp: string, mediaS
|
||||
let length: number;
|
||||
if (hasRstpPrefix) {
|
||||
header = await readLength(socket, 4);
|
||||
length = header.readInt16BE(2);
|
||||
length = header.readUInt16BE(2);
|
||||
}
|
||||
else {
|
||||
header = await readLength(socket, 2);
|
||||
length = header.readInt16BE(0);
|
||||
length = header.readUInt16BE(0);
|
||||
}
|
||||
const data = await readLength(socket, length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user