Skip to content

Simplify advance method on SpanTracker#874

Merged
yara-blue merged 4 commits intoRustAudio:masterfrom
Keinsleif:feature/change_span_tracker_api
Apr 21, 2026
Merged

Simplify advance method on SpanTracker#874
yara-blue merged 4 commits intoRustAudio:masterfrom
Keinsleif:feature/change_span_tracker_api

Conversation

@Keinsleif
Copy link
Copy Markdown
Contributor

Similar code appear on some sources.

let current_sample_rate = self.input.sample_rate();
let current_channels = self.input.channels();
let input_span_len = self.input.current_span_len();

I think this is not clean.

I used code similar to the seek method to fix this.
Now, advance method receive reference for Source.

Also, channel count and sample rate are not used on loops that are not boundaries.
In this PR, SpanTracker retrieves them from input source only on boundaries.

@Keinsleif
Copy link
Copy Markdown
Contributor Author

I'm not very familiar with how SpanTracker works, but is this working correctly?

Copy link
Copy Markdown
Member

@yara-blue yara-blue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this will work nicely :)

Lovely cleanup thank you for contributing it!

@yara-blue yara-blue merged commit 57ad9d8 into RustAudio:master Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants