Skip to content

Commit

Permalink
Move OPUS decoder buffer to heap (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 authored Dec 2, 2024
1 parent fbb781d commit 7ccafb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions build_tools/nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions compositor_pipeline/src/pipeline/decoder/audio/opus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{AudioDecoderExt, DecodedSamples, DecodingError};

pub(super) struct OpusDecoder {
decoder: opus::Decoder,
decoded_samples_buffer: [i16; 100_000],
decoded_samples_buffer: Vec<i16>,
forward_error_correction: bool,
decoded_sample_rate: u32,
}
Expand All @@ -29,7 +29,7 @@ impl OpusDecoder {
// Max sample rate for opus is 48kHz.
// Usually packets contain 20ms audio chunks, but for safety we use buffer
// that can hold >1s of 48kHz stereo audio (96k samples)
let decoded_samples_buffer = [0i16; 100_000];
let decoded_samples_buffer = vec![0; 100_000];

Ok(Self {
decoder,
Expand Down

0 comments on commit 7ccafb6

Please sign in to comment.