-
Notifications
You must be signed in to change notification settings - Fork 366
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 video backward seeking / stepping back sometimes getting stuck (in the presence of b-frames) #8053
Conversation
@@ -104,9 +109,23 @@ impl SamplesStatistics { | |||
.iter() | |||
.all(|s| s.decode_timestamp == s.presentation_timestamp); | |||
|
|||
let mut biggest_pts_so_far = Time::MIN; | |||
let has_sample_highest_pts_so_far = samples |
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.
I'm also a bit worried about how many times we're iterating over the samples here. I don't think LLVM will optimize this to one loop.
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.
tbh I'm not sure if it's better to combine everything to a single loop or to loop several times: individual loops might vectorize better
pure speculation until someone actually measures. Maybe I should. After all we might run this with a lot of samples!
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.
It optimizes a lot better than I thought: https://godbolt.org/z/n3Yvzff9e
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.
neither is in the mood for simd though. probably because everything is 64bit integer
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.
leaving it be as is for now
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.
Other than nits above this LGTM
known issue on |
What
Our PTS -> sample search algorithm wasn't quite right. Fixed this here and added a unit test.
Unfortunately, I had to introduce a small auxiliary data structure to keep this snappy / not O(n) for n samples, but it's very simple and rather contained.
Tested on native & web. Web still suffers from
but on Chrome this works fine now!
Screen.Recording.2024-11-08.at.16.55.06.mov
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.