feat: exit node on NDI source format change

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 <noreply@anthropic.com>
This commit is contained in:
JohannesItten
2026-07-01 12:27:06 +03:00
parent 10d1282059
commit ee47d85cbd
+12 -1
View File
@@ -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;
}