Skip to content

TakeDuration charges boundary samples at their original rate - #943

Open
kapok-4o wants to merge 1 commit into
RustAudio:masterfrom
kapok-4o:fix/adapter-3
Open

kapok-4o wants to merge 1 commit into
RustAudio:masterfrom
kapok-4o:fix/adapter-3

Conversation

@kapok-4o

Copy link
Copy Markdown

The last sample of a span may advance the input's metadata to the next format. TakeDuration used that new format when subtracting the sample's duration, which could underflow the remaining time and panic.

Account for the sample's duration and channel position before updating the format for the next sample. The regression takes 2 ms from two mono samples followed by slower stereo audio and checks that the output contains exactly the two mono samples.

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.

1 participant