fix: MXL_ERR_FLOW_INVALID reconnect, nullptr→"" options, null guards

Readers (ndiout, fakesink) now handle MXL_ERR_FLOW_INVALID by releasing
and recreating the flow reader, then realigning the index to current time.
This lets consumer nodes survive a producer restart without exiting.

All mxlCreateInstance/FlowWriter/FlowReader options args changed from
nullptr to "" to match MXL reference implementation style.

mxlReleaseFlowReader calls guarded with null checks so cleanup is safe
when a mid-run reconnect attempt fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
JohannesItten
2026-07-03 10:28:30 +03:00
parent 21a8ee4ba0
commit f2515b7ce2
6 changed files with 45 additions and 13 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ class TestPatternNode : public dmf::NodeBase {
mxlStatus vst = mxlCreateFlowWriter(
instance(),
dmf::make_video_flow_def(flow_id, node_id(), width, height, fps_num, fps_den).c_str(),
nullptr, &video_writer, &video_cfg, &created);
"", &video_writer, &video_cfg, &created);
if (vst != MXL_STATUS_OK) { log("video mxlCreateFlowWriter failed (%s)", dmf::mxl_status_str(vst)); return; }
const uint32_t video_stride = video_cfg.discrete.sliceSizes[0];
@@ -53,7 +53,7 @@ class TestPatternNode : public dmf::NodeBase {
instance(),
dmf::make_audio_flow_def(audio_flow_id, node_id(), sample_rate, channels, 32,
fps_num, fps_den).c_str(),
nullptr, &audio_writer, &audio_cfg, &created);
"", &audio_writer, &audio_cfg, &created);
if (ast != MXL_STATUS_OK) {
log("audio mxlCreateFlowWriter failed (%s) — continuing without audio", dmf::mxl_status_str(ast));
has_audio = false;