Repository navigation
FLAC: Avoid buffering the entire file during tag writes - #695
Merged
Merged
Conversation
Serial-ATA
requested changes
Aug 13, 2026
Serial-ATA
requested changes
Aug 14, 2026
Serial-ATA
force-pushed
the
flac-bounded-tag-write
branch
from
August 15, 2026 17:47
57a5224 to
4d0b3fb
Compare
Serial-ATA
approved these changes
Aug 15, 2026
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.
closes #694
This keeps the existing FLAC parsing and metadata encoding, but replaces the final whole-file buffer/splice with a bounded in-place range replacement.
The FLAC resize regression now covers FLAC directly. I also checked the historical #549/#607/#608/#640 failure modes, including no-padding/minimal layouts, last-metadata-block handling, leading ID3 data, and metadata shrink/grow. The large-file reproducer from #694 still passes
flac -twith the audio signature preserved while avoiding whole-file memory use.This does not try to solve #445: existing FLAC padding is still handled the same way, so audio may still need to move when metadata size changes.
AI disclosure: I used AI assistance during investigation, prototyping, test design, and drafting. I reviewed the behavior and failure modes, reproduced the tests and measurements locally, and will participate directly in review.