-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Symphonia seek for a duration with a fractional element of 0 #687
base: master
Are you sure you want to change the base?
Conversation
@dvdsk Ready for review - it was harder to get a 0ms test file than it should have been... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge as is, could make the unit test an integration test. Let me know what you choose and ill merge.
edit: oh and good find! thanks for fixing my bug (this one is my fault) 🎉
No worries - have moved this to be an integration test :) |
@@ -301,10 +301,13 @@ fn skip_back_a_tiny_bit( | |||
}: Time, | |||
) -> Time { | |||
frac -= 0.0001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybeif frac < 0.0001 { } else { }
instead?
Next to the beginning of the Source saturating_sub
will leave seconds unchanged, and the whole effect would be to actually seek forward almost a second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its never called at the beginning of the source. This handles seeking beyond a source end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is good to merge right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it fixes the problem - yes, we can merge. Since it is already an improvement.
We can handle other cases later if necessary.
The source itself can be less than a second long. The check compares with < 1ms overlap, but tick-back is 0.1ms. what about overlaps in range 0.1...1.0 ms? I wonder if there are any symphonia functions to work with its timestamps or ways to convert those from/to Duration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source itself can be less than a second long
ahh damn, I did not think of that. Thanks for clarifying. No I agree now, lets fix this properly only then merge. This will need a comment in the code explaining this case or a future refactor might throw the code out.
Fixes: #686