chore: clean up and optimisation

This commit is contained in:
2026-08-07 16:06:01 +01:00
parent 5f152e9db7
commit 3287a0ed7c
6 changed files with 132 additions and 170 deletions
+8 -1
View File
@@ -236,7 +236,8 @@ pub async fn handle_whip_injest(
// Insert the candidate line after the video m= line.
let cand_replacement = format!(
"m=video 9 UDP/TLS/RTP/SAVPF 96\r\nc=IN IP4 {}\r\n{}\r\n",
public_addr.ip(), cand_line
public_addr.ip(),
cand_line
);
answer_sdp.replace(
"m=video 9 UDP/TLS/RTP/SAVPF 96\r\nc=IN IP4 0.0.0.0\r\n",
@@ -277,11 +278,17 @@ pub async fn handle_whip_injest(
video_tx.set_overflow(true);
audio_tx.set_overflow(true);
let user = users::Entity::find_by_id(key.user_id)
.one(&db)
.await
.unwrap()
.unwrap();
stream_sessions.insert(
key.id,
StreamSession {
stream_key_id: key.id,
stream_key_label: key.label,
stream_key_user: user.username,
frame_channel: video_tx,
audio_channel: audio_tx,
codec: negotiated_codec,