mirror of
https://github.com/koush/scrypted.git
synced 2026-09-17 17:20:39 +01:00
rebroadcast: reduce inactivity timeout to 10 seconds. watch for invalid server_port values in rtsp session.
This commit is contained in:
@@ -929,7 +929,7 @@ class PrebufferSession {
|
||||
}
|
||||
this.console.log(this.streamName, 'terminating rebroadcast due to inactivity');
|
||||
session.kill(new Error('stream inactivity'));
|
||||
}, 30000);
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
async handleRebroadcasterClient(options: {
|
||||
|
||||
@@ -127,9 +127,12 @@ export async function startRtspSession(console: Console, url: string, mediaStrea
|
||||
const transport = setupResult.headers['transport'];
|
||||
const match = transport.match(/.*?server_port=([0-9]+)-([0-9]+)/);
|
||||
const [_, rtp, rtcp] = match;
|
||||
const { hostname } = new URL(rtspClient.url);
|
||||
udp.send(punch, parseInt(rtp), hostname)
|
||||
|
||||
const rtpPort = parseInt(rtp);
|
||||
// have seen some servers return a server_port 0. should watch for bad data in any case.
|
||||
if (rtpPort) {
|
||||
const { hostname } = new URL(rtspClient.url);
|
||||
udp.send(punch, rtpPort, hostname)
|
||||
}
|
||||
mapping[channel] = codec;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user