Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: appropriate encoding #265

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions livekit/src/room/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ pub fn compute_appropriate_encoding(
let presets = compute_presets_for_resolution(is_screenshare, width, height);
let size = u32::max(width, height);

let mut encoding = presets.first().unwrap().encoding.clone();

for preset in presets {
encoding = preset.encoding.clone();
if preset.width >= size {
return preset.encoding.clone();
break;
}
}

unreachable!()
encoding
}

pub fn compute_presets_for_resolution(
Expand Down
Loading