Idea/proposal: Total_duration enum (unknown/max/guarenteed)
Nobody has claimed this yet.
- #863 by @Sim-hu — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- audio-video-rtc
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- 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