mirror of
https://github.com/taglib/taglib.git
synced 2026-08-14 06:17:00 -04:00
8e6fdb42959d17bfe70823ff6bfce8aea4e36255
Reading the tags of a file materialised every attachment, so a fast read of a file with cover art cost as much as the art is large, even though the caller may never ask for it. Measured with a counting IOStream over tests/data/no-tags.mka with an attachment behind its seek head, read with AudioProperties::Fast: attachment | read before | read now ---------------------------------- 128 KiB | 131350 B | 278 B 512 KiB | 524544 B | 256 B 4 MiB | 4194563 B | 259 B The number of read calls is unchanged (183, 164, 164 before; 182, 163, 163 now), so this is volume, not round trips, and what remains does not grow with the payload. MkAttachedFileData is now a DeferredBinaryElement, which registers the offset of its data and skips over it. Matroska::File::attachments() reads the data before handing the attachments out, so callers see no difference. save() renders the attachments from the attached files, which would write an empty attachment for data that was never requested. It therefore loads the data before writing. Co-authored-by: Claude Opus 5 <[email protected]>
TagLib
TagLib Audio Metadata Library
TagLib is a library for reading and editing the metadata of several popular audio formats. Currently, it supports various metadata containers such as ID3v1, ID3v2 and Vorbis comments for MP3, MP4, AAC, Ogg, Opus, FLAC, Speex, APE, MPC, WavPack, WAV, AIFF, TrueAudio, Matroska, WebM, ASF, WMA, DSF, DFF and tracker (MOD, XM, S3M, IT) files.
TagLib is distributed under the GNU Lesser General Public License (LGPL) and Mozilla Public License (MPL). Essentially that means that it may be used in proprietary applications, but if changes are made to TagLib they must be contributed back to the project. Please review the licenses if you are considering using TagLib in your project.
Languages
C++
96.7%
CMake
2%
C
0.9%
Logos
0.4%