Repository navigation
fix(au): round the host's sample time instead of truncating it - #27
Merged
Merged
Conversation
transportStateProc and AudioTimeStamp report the timeline as f64 samples, and a host can report an integer position as a value just below it (REAPER AU: 11775 where it moved back to 11776, and a running position one sample early every few buffers). `as i64` truncated it to the sample before. Round through the new Transport::samples_from_host_time, which also maps NaN and infinity to no position instead of 0 / i64::MAX. Loop ranges get the same conversion.
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.
AU hosts report the timeline as f64 samples (
transportStateProcoutCurrentSampleInTimeLine,AudioTimeStamp::mSampleTime). REAPER can report an integer position as a value just below it, andsample_pos as i64then gives the sample before: de-leak-rt logged a jump target of 11775 where REAPER moved back to 11776, and a running position one sample early in 632 of 1266 buffers (Intrect-io/de-leak-rt docs/VERIFY-0.2.3-SHIPPED.md, Linear AUD-2503).Transport::samples_from_host_time(f64) -> Option<i64>: round, then the existingf64_to_i64guard (NaN/inf → None instead of 0 / saturation).mSampleTimefallback go through it.context::process;cargo check --lib --features auon macOS (M1 Max) passes.Based on e39670f (the rev de-leak-rt pins) so de-leak-rt 0.2.4 can take this fix alone. Merge with a merge commit so fd96420 stays reachable from master.