mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-02 15:35:09 -04:00
Correct three problems in the stream socket generation tracking added by the previous review fix-up: - ClearAudioParams bumped the generation without restarting the video sequence or dropping the cached keyframe, so a late joiner received a HELLO at generation N+1 followed by a KEYFRAME still stamped N, and sequences did not restart as documented. It now does the same full bump as SetVideoParams/SetAudioParams. - zm_rtsp_server rebuilt the xop session whenever the generation changed, even with identical codec parameters. Generations restart at 0 when zmc restarts, so every zmc restart dropped the RTSP clients; the original code kept the session in that case. Unchanged parameters now just adopt the new generation without a teardown. - Deciding whether audio belongs to the current generation by comparing per-stream generation numbers raced the two HELLOs of a generation (double rebuild when Update() ran between them) and cannot tell a producer restart apart. The producer now sends the audio HELLO before the video HELLO within a generation (on connect and on every bump, and PrimeCapture announces audio before video), so the video HELLO always completes a generation's parameter set. The consumer forgets the previous generation's HELLOs when a new generation starts and on disconnect, and builds only once the video HELLO of the latest generation is in. It also records whether audio was announced at build time rather than whether a packer was created, so an unsupported audio codec no longer triggers a rebuild on every pass. The ordering guarantee is documented in the protocol header and the stream socket docs. Tests pin the audio-first order on connect and on a video reconfigure, and the keyframe drop and sequence restart on audio removal. refs #5143 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T4UcdJLt1bxwdpcigGxZRD
The latest version of these docs can be found at http://zoneminder.readthedocs.org/