Open
Description
Idea by @The0x539 #626 (comment). 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
.