From c2e823beda580ba3fa74ace4ed8b47149908cc15 Mon Sep 17 00:00:00 2001 From: Johanness Date: Sat, 30 May 2026 23:10:35 +0300 Subject: [PATCH] fix realignment --- nodes/decklink-out/src/decklink_out_node.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nodes/decklink-out/src/decklink_out_node.cpp b/nodes/decklink-out/src/decklink_out_node.cpp index 4278194..e51a641 100644 --- a/nodes/decklink-out/src/decklink_out_node.cpp +++ b/nodes/decklink-out/src/decklink_out_node.cpp @@ -239,12 +239,16 @@ void DeckLinkOutNode::process() { if (status == MXL_ERR_OUT_OF_RANGE_TOO_LATE || status == MXL_ERR_OUT_OF_RANGE_TOO_EARLY) { auto now = mxlGetTime(); auto current_index = mxlTimestampToIndex(&flow_rate_, now); - read_index_ = current_index - 2; - if (grains_read_ == 0) { - spdlog::warn("DeckLink-out: realigned to source index {}", read_index_); + spdlog::warn("DeckLink-out: realigned from {} to {}", source_index, current_index - 2); + source_index = current_index - 2; + + status = mxlFlowReaderGetGrain(*reader_, source_index, 5000000ULL, &grain_info, &payload); + if (status != MXL_STATUS_OK) { + return; } + } else { + return; } - return; } mxlFlowConfigInfo config{};