Skip to content

don't use clamp as the ultimate_kbps can be lower than 300#886

Merged
xianshijing-lk merged 1 commit intomainfrom
sxian/fix_panic_when_start_bitrate_is_lower_than_300
Feb 10, 2026
Merged

don't use clamp as the ultimate_kbps can be lower than 300#886
xianshijing-lk merged 1 commit intomainfrom
sxian/fix_panic_when_start_bitrate_is_lower_than_300

Conversation

@xianshijing-lk
Copy link
Contributor

The problem with Some(start_kbps.clamp(300, ultimate_kbps)) is that the ultimate_kbps can be lower than 300 when the resolution is low.

In that case Rust will crash

Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@xianshijing-lk xianshijing-lk merged commit 1560ef0 into main Feb 10, 2026
21 checks passed
@xianshijing-lk xianshijing-lk deleted the sxian/fix_panic_when_start_bitrate_is_lower_than_300 branch February 10, 2026 22:29
This was referenced Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments