From ee47d85cbdb1fffee2178237c1e0601dda014e82 Mon Sep 17 00:00:00 2001 From: JohannesItten Date: Wed, 1 Jul 2026 12:27:06 +0300 Subject: [PATCH] feat: exit node on NDI source format change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On status_change, probe() the new format and compare against the format used to create the MXL flow. If resolution or fps changed, throw with a descriptive message so the caller exits cleanly. The existing catch in NDIInNode::run() logs the reason and breaks out of the loop, causing the process to exit. Studio-manager detects the exit and logs it — operator can restart to pick up the new format. Same-format status changes (e.g. metadata only) still return false and repeat the last frame as before. Co-Authored-By: Claude Sonnet 4.6 --- shared/NDIReceiver.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/shared/NDIReceiver.hpp b/shared/NDIReceiver.hpp index aea4654..accc306 100644 --- a/shared/NDIReceiver.hpp +++ b/shared/NDIReceiver.hpp @@ -123,7 +123,18 @@ public: throw std::runtime_error("NDI source lost"); if (type == NDIlib_frame_type_status_change) { - info_ = probe(); // source changed resolution or framerate — refresh + const SourceInfo old = info_; + info_ = probe(); + if (info_.width != old.width || info_.height != old.height || + info_.fps_num != old.fps_num || info_.fps_den != old.fps_den) { + throw std::runtime_error( + "source format changed: " + + std::to_string(old.width) + "x" + std::to_string(old.height) + + " @" + std::to_string(old.fps_num) + "/" + std::to_string(old.fps_den) + + " -> " + + std::to_string(info_.width) + "x" + std::to_string(info_.height) + + " @" + std::to_string(info_.fps_num) + "/" + std::to_string(info_.fps_den)); + } return false; }