You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
Idea by @The0x539 #626 (comment). Currently infinite sources will return
None
fortotal_duration
, when paired with aTakeDuration
you still getNone
. Another place we can do better isskippable
. Right now askippable
will pass on thetotal_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: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 amap
,is_known
and maybe anunwrap_or
.A far simpler alternative to this proposal would be making infinite sources return
Duration::MAX
.The text was updated successfully, but these errors were encountered: