diff --git a/plugins/prebuffer-mixin/src/main.ts b/plugins/prebuffer-mixin/src/main.ts index f6f8957a7..65f08dc95 100644 --- a/plugins/prebuffer-mixin/src/main.ts +++ b/plugins/prebuffer-mixin/src/main.ts @@ -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: { diff --git a/plugins/prebuffer-mixin/src/rtsp-session.ts b/plugins/prebuffer-mixin/src/rtsp-session.ts index 25a452e41..5c8c9c6ba 100644 --- a/plugins/prebuffer-mixin/src/rtsp-session.ts +++ b/plugins/prebuffer-mixin/src/rtsp-session.ts @@ -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 {