Handle PTS resets in throttled detectors

This commit is contained in:
tian 2026-03-14 13:10:49 +08:00
parent 29a5401300
commit 73ea8dfd03
2 changed files with 4 additions and 2 deletions

View File

@ -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<int64_t>(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;
}

View File

@ -752,7 +752,8 @@ public:
if (infer_interval_ms_ > 0 && frame->pts > 0) {
const int64_t pts_ms = static_cast<int64_t>(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;