Skip to content

Commit

Permalink
Driver: Fix slot length check on packet passthrough (#231)
Browse files Browse the repository at this point in the history
Corrects a buffer length check identified in #230 which was reversed,
such that overly large Opus packets would panic on a subsequent
`write_all`.
  • Loading branch information
FelixMcFelix committed Mar 4, 2024
1 parent 8f60cf5 commit 58f5c89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/driver/tasks/mixer/mix_logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn mix_symph_indiv(
// seen. The main one is that most Opus tracks end on a sub-20ms
// frame, particularly on Youtube.
// However, a frame that's bigger than the target buffer is an instant block.
let buf_size_fatal = buf.len() <= slot.len();
let buf_size_fatal = buf.len() >= slot.len();

if match sample_ct {
Ok(MONO_FRAME_SIZE) => true,
Expand Down

0 comments on commit 58f5c89

Please sign in to comment.