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; }