Fix logic for clearing held peaks#3
Merged
Merged
Conversation
pablosichert
approved these changes
Jul 3, 2025
Author
|
@pablosichert This needs another look. There was more wrong with the code than I first realized. I updated the PR description with some context. |
jlnstrk
force-pushed
the
jlnstrk/clear-peaks-race
branch
from
July 7, 2025 10:48
c3cf102 to
2129b32
Compare
pablosichert
approved these changes
Jul 8, 2025
|
Without publishing a new release these changes will have no effect as the transpiled sources aren't updated. In particular just referencing a git commit like in https://github.com/hypervideo/hyper.video/pull/3174/files#r2202509104 will still use the old version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes some logic errors where held peaks are reset
peakHoldDuraton(or the correspondingsetTimeout) expires before new peaks are received from the worklet, effectively resetting to the same value. With this, the output value could only ever increase, but never decrease.setTimeoutwas scheduled, in the callback of which we set the held peaks equal to the current peaks. But the value after reset (the current peaks) did not get a correspondingsetTimeout. As a result, it also could only be superseded by a larger one.This is quite likely the same bug mentioned in #1 (review).