`Decoder::new` silently zeros data
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- audio-video-rtc
Research direction
Compare Decoder::new(BufReader<File>) with Decoder::try_from(File) in the decoder implementation and its tests, focusing on the Symphonia MP4/AAC path and the related issue #846. Start by reproducing the reported sample counts with the provided test file and feature flags; done means both construction paths produce nonzero audio samples for that input.
Written by the indexing model from the issue text.
Description
Initial issue is from https://github.com/marin-m/SongRec/issues/263
Related issue: #846
Code to reproduce:
use std::fs::File;
use std::io::BufReader;
fn main() {
let file = File::open("video.mp4").unwrap();
let decoder = rodio::Decoder::new(BufReader::new(file)).unwrap();
let mut count = 0u64;
let mut nonzero = 0u64;
for s in decoder {
count += 1;
if s != 0.0 { nonzero += 1; }
if count > 16_000 * 30 { break; }
}
eprintln!("[BROKEN] Decoder::new(BufReader): samples={count} nonzero={nonzero}");
let decoder = rodio::Decoder::try_from(File::open("video.mp4").unwrap()).unwrap();
let mut count = 0u64;
let mut nonzero = 0u64;
for s in decoder {
count += 1;
if s != 0.0 { nonzero += 1; }
if count > 16_000 * 30 { break; }
}
eprintln!("[WORKING] Decoder::try_from: samples={count} nonzero={nonzero}");
}
[package]
name = "rodio-test"
version = "0.1.0"
edition = "2024"
[dependencies]
rodio = { git = "https://github.com/RustAudio/rodio.git", default-features = false, features = [
"symphonia-isomp4", "symphonia-aac",
] }
Output:
[BROKEN] Decoder::new(BufReader): samples=2048 nonzero=0
[WORKING] Decoder::try_from: samples=480001 nonzero=469761
Works only on git, on the latest release, that is, 0.22.2 the working code is broken (there was a commit that fixed it).
Test file:
https://github.com/user-attachments/assets/ccf223c9-b1e7-4feb-8ae9-7744ff9cd165
LLM yap (may be helpful, IDK):
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustAudio/rodio
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
ci: migrate pinned macos-15 runners to macos-26 and macos-26-intelPossibly taken @hawkingrei claimed this today. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nowledge-co/hawdb#2224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-score/coverage_tool#95 ·
Maintainers usually reply within 2 days
-
bug nvim
Difficulty 2/5 1-3 hours Newbie friendliness 74/100