Audio resampler postroll fix - #1615
Merged
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1615
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 16 PendingAs of commit d0f3f19 with merge base de0340f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
NicolasHug
force-pushed
the
audio-resampler-postroll
branch
2 times, most recently
from
August 12, 2026 08:11
2d76f5f to
3c8c927
Compare
NicolasHug
force-pushed
the
audio-resampler-postroll
branch
from
August 12, 2026 08:34
3c8c927 to
729835d
Compare
swresample holds back the samples that need input we haven't fed it yet. maybe_flush_audio_buffers() converts whatever is still held back at the end of a range, with silence standing in for that input, so those samples don't match what decoding the stream start to finish produces. They sit at the very end of what we decoded, and usually fall outside the requested range and get trimmed away. Not always: decoding stops on the frame containing stop_seconds, which can end a fraction of a millisecond after it. Decoding a filter's worth of input further keeps them clear of the requested range.
NicolasHug
force-pushed
the
audio-resampler-postroll
branch
from
August 12, 2026 08:34
729835d to
d0f3f19
Compare
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.
Direct follow-up to #1614 which focused on pre-roll, this one is about post-roll.
Stack created with GitHub Stacks CLI • Give Feedback 💬