From 3435ef27fffca19827f5f19e663c72ca3bda3632 Mon Sep 17 00:00:00 2001 From: TrungDinhT Date: Wed, 5 Apr 2023 12:55:22 +0200 Subject: [PATCH] Fix bug in timestamp bound propagation for CLONE --- mediapipe/calculators/core/begin_loop_calculator.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mediapipe/calculators/core/begin_loop_calculator.h b/mediapipe/calculators/core/begin_loop_calculator.h index 81fff39da..739905bc4 100644 --- a/mediapipe/calculators/core/begin_loop_calculator.h +++ b/mediapipe/calculators/core/begin_loop_calculator.h @@ -175,6 +175,11 @@ class BeginLoopCalculator : public CalculatorBase { cc->Outputs() .Get("CLONE", i) .AddPacket(std::move(input_packet).At(output_timestamp)); + } else { + // In case the clone input stream is empty, timestamp bound needs to be updated so that downstream calculators don't have to wait + // Increment output_timestamp by 1 to signal that the output is empty for current timestamp. This allows downstream calculators + // to start processing on their current inputs. + cc->Outputs().Get("CLONE", i).SetNextTimestampBound(output_timestamp + 1); } } }