From fe2ccb07e123a9d55d727499dc946110c25aef87 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 15 Oct 2026 02:05:29 +0200 Subject: [PATCH] Keep 60 fps downsampling away from half-period ties --- tools/chatgui/src/call_video_cadence.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/chatgui/src/call_video_cadence.h b/tools/chatgui/src/call_video_cadence.h index bd68cd7e..dfbaad84 100644 --- a/tools/chatgui/src/call_video_cadence.h +++ b/tools/chatgui/src/call_video_cadence.h @@ -1,7 +1,7 @@ #pragma once #include -// Сетка 30 fps с допуском половины периода: дрожание PTS не превращает 30 fps в 15. +// Сетка 30 fps с допуском четверти периода: дрожание PTS не превращает 30 fps в 15. class CallVideoCadence { int64_t origin = -1, lastSlot = -1; public: @@ -9,7 +9,7 @@ public: if (origin < 0) origin = pts; if (pts < origin) return false; const int64_t elapsed = pts - origin; - const int64_t slot = (elapsed / 1000000) * 30 + ((elapsed % 1000000) * 30 + 500000) / 1000000; + const int64_t slot = (elapsed / 1000000) * 30 + ((elapsed % 1000000) * 30 + 250000) / 1000000; if (slot <= lastSlot) return false; lastSlot = slot; return true;