Open
Description
Right now we just retain existing padding and add some if it's missing.
- MP4: Utilize
free
atoms surroundingilst
atoms- Calculate space available before writing
- When writing, all available space is taken into consideration. This includes all
free
atoms before AND after theilst
, as well as theilst
itself. Any remaining space is converted back to padding.- This means if you save a 500 byte tag to the following file:
free
(250 bytes)ilst
(250 bytes)free
(250 bytes)
- The result will be:
ilst
(500 bytes)free
(250 bytes)
- This means if you save a 500 byte tag to the following file:
- When writing, all available space is taken into consideration. This includes all
- Do not rewrite the entire file
- We should be able to update the tag as above and its offsets without having to rewrite the entire file.
- Calculate space available before writing
- FLAC: Utilize
PADDING
blocks- We should be able to handle the cases:
- No padding, write as normal and append to the end
- Padding exists at the end, do not rewrite the file if it's enough
- Still rewrite if the remaining padding is less than the
preferred_padding
- Still rewrite if the remaining padding is less than the
- Padding exists between blocks, such as after
VORBIS_COMMENTS
and before aPICTURE
- We should be able to grow the
VORBIS_COMMENTS
and leavePICTURE
alone if possible. (?)
- We should be able to grow the
- We should be able to handle the cases:
- ID3v2: Simply overwrite tags
- ID3v2 supports padding, so if
tag_to_write.len() <= existing_tag.len()
, we can simply writetag_to_write
at the beginning of the file and replace any remaining size with padding. - This only applies to formats where ID3v2 can be written to the beginning of the file (not IFF formats)
- ID3v2 supports padding, so if