Files
scrypted/plugins
JoshADC 7112e049cb rebroadcast: fix RTMP acknowledgement uint32 overflow (#1980)
The RTMP client's totalBytesReceived counter grows unbounded as a
JavaScript number. When it exceeds 2^31 (~2.15 GB received), the
writeUInt32BE call in sendAcknowledgementIfNeeded throws a RangeError
because JavaScript bitwise operations produce signed 32-bit integers.
This crashes the RTMP session and drops the video stream.

For a high-bitrate camera like the Reolink D340P (~4 Mbps main stream),
this overflow occurs after approximately 90 minutes of continuous
streaming, causing periodic stream drops at a consistent interval.

Fix by using the unsigned right shift operator (>>> 0) to keep
totalBytesReceived and bytesToAck in the unsigned uint32 range [0,
4294967295], matching the RTMP spec's sequence number wrapping behavior.

Co-authored-by: Josh Casada <joshcasada@Joshs-Mac-mini.ts.net lan>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:53:46 -08:00
..
2025-03-21 08:08:27 -07:00
2026-01-08 08:31:57 -08:00
2024-03-25 12:44:25 -07:00
2026-01-21 16:21:15 -08:00
2025-07-31 11:03:24 -07:00
2024-02-12 15:52:11 -08:00
2024-08-10 10:36:26 -07:00
2025-10-03 08:03:47 -07:00
2025-08-28 09:44:48 -07:00
2024-11-08 09:14:11 -08:00
2025-12-27 09:21:54 -08:00
2025-06-18 14:01:16 -07:00
2023-06-30 17:58:23 -07:00
2026-01-19 22:16:44 -08:00
2025-07-22 11:11:16 -07:00
2024-11-15 10:02:13 -08:00