From d506e70740e958e92d4573d9c56224c1b8ec31d4 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 15 Sep 2025 09:26:25 +0200 Subject: [PATCH] Disable opus red for e2ee enabled clients --- livekit/src/room/participant/local_participant.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index edeac969b..4ed2998b6 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -232,6 +232,8 @@ impl LocalParticipant { track: LocalTrack, options: TrackPublishOptions, ) -> RoomResult { + let disable_red = self.local.encryption_type != EncryptionType::None || !options.red; + let mut req = proto::AddTrackRequest { cid: track.rtc_track().id(), name: track.name(), @@ -239,7 +241,7 @@ impl LocalParticipant { muted: track.is_muted(), source: proto::TrackSource::from(options.source) as i32, disable_dtx: !options.dtx, - disable_red: !options.red, + disable_red, encryption: proto::encryption::Type::from(self.local.encryption_type) as i32, stream: options.stream.clone(), ..Default::default()