From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Sun, 24 May 2026 19:43:21 +0400
Subject: fix a/v sync in round messages with camera2

---
 .../java/org/telegram/messenger/camera/Camera2Session.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/camera/Camera2Session.java b/TMessagesProj/src/main/java/org/telegram/messenger/camera/Camera2Session.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/camera/Camera2Session.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/camera/Camera2Session.java
@@ -490,7 +490,8 @@ public class Camera2Session {
             captureRequestBuilder.set(CaptureRequest.FLASH_MODE, flashing ? (recordingVideo ? CaptureRequest.FLASH_MODE_TORCH : CaptureRequest.FLASH_MODE_SINGLE) : CaptureRequest.FLASH_MODE_OFF);
 
             if (recordingVideo) {
-                captureRequestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, new Range<Integer>(30, 60));
+                // inu: capping to 30 fps to prevent a/v sync drift. more of a workaround, but it works :shrug:
+                captureRequestBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, new Range<Integer>(30, 30));
                 captureRequestBuilder.set(CaptureRequest.CONTROL_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_VIDEO_RECORD);
             }
 
