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

Move OPUS decoder buffer to heap #889

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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