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

Idea/proposal: Total_duration enum (unknown/max/guarenteed)

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

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

  • #863 của @Sim-hu — đã đóng, không merge

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

Read the linked proposal in issue #626 and compare it with the existing total_duration behavior described here, including TakeDuration and skippable. The issue proposes a SourceDuration enum and helper methods, with returning Duration::MAX for infinite sources as a simpler alternative; first determine whether either approach is still wanted. Done means the project has chosen and implemented a consistent duration representation for these cases.

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

Mô tả

enhancement good first issue

Idea by @The0x539 https://github.com/RustAudio/rodio/issues/626#issuecomment-2661094585. Currently infinite sources will return None for total_duration, when paired with a TakeDuration you still get None. Another place we can do better is skippable. Right now a skippable will pass on the total_duration of what it wraps. Because the source can be skipped at any point there is no guarentee it will actually play for that length.

To address these issues we can put extra information in the total_duration result:

enum SourceDuration {
  Max(Duration),
  Guarenteed(Duration),
  Infinite,
  Unknown,
}

We could provide methods to turn this into an option returning Duration::MAX for Infinite. We could call that method known. We could also provide a map, is_known and maybe an unwrap_or.

A far simpler alternative to this proposal would be making infinite sources return Duration::MAX.

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.