Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`Decoder::new` silently zeros data

Đang mở
#879 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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):

report.md

Ngôn ngữ chính
Rust
Star
2.5k
Fork
338
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RustAudio/rodio

Tất cả issue của RustAudio/rodio

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.