diff --git a/src/call/call_video_playout.c b/src/call/call_video_playout.c index 80345013..549bc4a4 100644 --- a/src/call/call_video_playout.c +++ b/src/call/call_video_playout.c @@ -69,7 +69,8 @@ enum call_video_playout_action call_video_playout_poll(struct call_video_playout // Аудио задаёт базовый темп; долг видео снимается с постоянной 0.5с, максимум 1.6x. int64_t av = f->pts_us - audio; uint32_t base = clock->rate_ppm > 1000000 ? clock->rate_ppm : 1000000; - int64_t speed = base + (av < 0 ? -av * 2 : 0); + int64_t correction = av < -300000 ? 600000 : av < 0 ? -av * 2 : 0; + int64_t speed = base + correction; p->speed_ppm = speed < VIDEO_MAX_SPEED_PPM ? (uint32_t)speed : VIDEO_MAX_SPEED_PPM; int64_t delta = p->last_pts >= 0 ? f->pts_us - p->last_pts : 0; int64_t step = delta / p->speed_ppm * 1000000 + delta % p->speed_ppm * 1000000 / p->speed_ppm;