From 73ea8dfd031560aaf51c26be1a7ba4b8bb9c5048 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Sat, 14 Mar 2026 13:10:49 +0800 Subject: [PATCH] Handle PTS resets in throttled detectors --- plugins/ai_shoe_det/ai_shoe_det_node.cpp | 3 ++- plugins/ai_yolo/ai_yolo_node.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/ai_shoe_det/ai_shoe_det_node.cpp b/plugins/ai_shoe_det/ai_shoe_det_node.cpp index 366501c..f432db9 100644 --- a/plugins/ai_shoe_det/ai_shoe_det_node.cpp +++ b/plugins/ai_shoe_det/ai_shoe_det_node.cpp @@ -158,7 +158,8 @@ public: #if defined(RK3588_ENABLE_RKNN) if (infer_interval_ms_ > 0 && frame->pts > 0) { const int64_t pts_ms = static_cast(frame->pts / 1000ULL); - if (last_infer_pts_ms_ > 0 && (pts_ms - last_infer_pts_ms_) < infer_interval_ms_) { + const int64_t delta_ms = pts_ms - last_infer_pts_ms_; + if (last_infer_pts_ms_ > 0 && delta_ms > 0 && delta_ms < infer_interval_ms_) { Push(frame); return NodeStatus::OK; } diff --git a/plugins/ai_yolo/ai_yolo_node.cpp b/plugins/ai_yolo/ai_yolo_node.cpp index b5519f0..3a14458 100644 --- a/plugins/ai_yolo/ai_yolo_node.cpp +++ b/plugins/ai_yolo/ai_yolo_node.cpp @@ -752,7 +752,8 @@ public: if (infer_interval_ms_ > 0 && frame->pts > 0) { const int64_t pts_ms = static_cast(frame->pts / 1000ULL); - if (last_infer_pts_ms_ > 0 && (pts_ms - last_infer_pts_ms_) < infer_interval_ms_) { + const int64_t delta_ms = pts_ms - last_infer_pts_ms_; + if (last_infer_pts_ms_ > 0 && delta_ms > 0 && delta_ms < infer_interval_ms_) { PushToDownstream(frame); ++processed_; return NodeStatus::OK;