Commit Graph

538 Commits

Author SHA1 Message Date
f32b503f56 Fix bitrate calculation unit errors in ADTS and MP4 ESDS parsers (#1330)
mpegheader.cpp: ADTS bitrate divided by 1024 (binary kilo) instead of
1000 (decimal kilo), causing ~2.4% underreporting for all AAC streams.

mp4properties.cpp: ESDS averageBitrate double-rounded via both +500 and
+0.5 before int cast, causing standard bitrates (128000, 192000, etc.)
to read 1 kbps too high.
2026-04-04 16:34:37 +02:00
b7f0225f0d Do not allow unknown frames embedded in CTOC and CHAP (#1306)
This prevents the parsing of frames with specially constructed recursive
frame hierarchies from taking an extremely long time.
2026-02-15 08:38:14 +01:00
397b6c1de3 Add check for ID3v2 frame data length (#1300)
Also fix some wrong frame sizes in the unit tests.

---------

Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2026-01-31 08:24:54 +01:00
51f431c96a Verify the ID3v2 version and revision are not 0xFF (#1301) 2026-01-31 08:21:17 +01:00
148cc9a921 Fix conversion compiler warnings
Using a release build with GCC 14.2.0 and -Wextra -Wconversion -Wall.
The generated binaries are not changed by this commit.
2025-06-25 22:08:09 +02:00
88d6b18b4f Convert IPLS to TIPL and TMCL (#1274)
The involvement/involvee pairs which are supported for TIPL properties
(ARRANGER, ENGINEER, PRODUCER, DJ-MIX, MIX) are left in the TIPL
frame, other pairs are moved to a TMCL frame. This will result in a
consistent behavior for both ID3v2.3 and ID3v2.4 tags produced by
MusicBrainz Picard.
2025-06-21 10:45:43 +02:00
d61a333f27 Map lowercase MusicBrainz TIPL keys to properties (#1274) 2025-06-21 10:45:43 +02:00
ee1931b811 Compile time configuration of supported formats (#1262)
CMake options WITH_APE, WITH_ASF, WITH_DSF, WITH_MOD, WITH_MP4,
WITH_RIFF, WITH_SHORTEN, WITH_TRUEAUDIO, WITH_VORBIS, by default,
they are all ON.
2025-02-02 12:24:26 +01:00
3bc0ea0ecb Preserve unicode encoding when downgrading to ID3v2.3 (#1259) (#1260) 2024-12-22 12:07:25 +01:00
3d4428726e Fix parsing of ID3v2.2 frames (#1228) 2024-05-18 06:43:00 +02:00
8a65068f3b clang-tidy: fix wrong cast
Found with bugprone-misplaced-widening-cast

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-01-22 18:35:30 +01:00
a08acdcf23 Remove unused types from taglib.h 2024-01-21 20:46:27 +01:00
e49390c7c5 Inspection: Type can be replaced with auto 2024-01-21 20:46:27 +01:00
7bcfb96098 Inspection: Code redundancies 2024-01-21 20:46:27 +01:00
580b0b0c82 Inspection: Possibly unused #include directive 2024-01-21 20:46:27 +01:00
c3d73a26ff Inspection: Parameter names do not match 2024-01-21 20:46:27 +01:00
1a5c417558 Inspection: Function is not implemented 2024-01-21 20:46:27 +01:00
d87b2dad48 Inspection: Expression can be simplified 2024-01-21 20:46:27 +01:00
613355665c Inspection: Variable can be moved to inner scope 2024-01-21 20:46:27 +01:00
dfe2aa5253 Inspection: Variable can be moved to init statement 2024-01-21 20:46:27 +01:00
5d921c6325 Inspection: Variable can be made constexpr 2024-01-21 20:46:27 +01:00
710522e6e1 Inspection: Result of a postfix operator is discarded 2024-01-21 20:46:27 +01:00
6b17aa3694 Inspection: Parameter can be made pointer to const 2024-01-21 20:46:27 +01:00
be8d71dad8 MSVC: fix signed/unsigned comparison
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-01-19 21:57:55 +01:00
6abbe579a2 clang-tidy: remove virtual from prot destructors
Found with cppcoreguidelines-virtual-class-destructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-01-19 21:57:55 +01:00
208fc93aaa cppcheck: match function argument names
Found with funcArgNamesDifferent

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-01-19 21:57:55 +01:00
0318201fbd Make classes with destructor as only virtual member non-virtual
These classes are probably not meant to be used polymorphically.
2024-01-17 21:25:44 +01:00
6c1ba88eab Make Frame::Header::size(), Frame::headerSize() const 2024-01-17 21:25:44 +01:00
fb0f7dfa57 More API documentation corrections 2024-01-17 20:54:56 +01:00
c5d798a50d Correct the API documentation 2024-01-04 17:18:23 +01:00
1635d4d563 clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-12-22 13:41:34 +01:00
56fa36934e Unify File constructors with ID3v2::FrameFactory parameter (#1196)
Make constructors consistent so that the FrameFactory is at the
end and optional. Mark the alternative constructors as deprecated.
2023-12-22 13:41:13 +01:00
9a08678098 Fix implicit long to int conversions 2023-12-18 17:29:39 +01:00
c9486731d9 Fix MSVC warning needs to have dll-interface (#1185)
Unfortunately, MSVC exports everything (not only public members) when
__declspec(dllexport) is set at the class level via TAGLIB_EXPORT, which
leads to many "needs to have dll-interface to be used by clients" 4251
warnings issued by MSVC, because the std::unique_ptr pimpls are
exported too. As it is not possible to "unexport" private members,
such a warning has to be explicitly suppressed for these cases or
all public and protected class member now have to be exported
for classes derived from a template (StringList, ByteVectorList,
PropertyMap).
2023-12-11 06:35:08 +01:00
28baa03b23 Improve doc comments for PrivateFrame 2023-12-11 06:35:08 +01:00
10094f66b9 Remove deprecated APE value(), toStringList(), ID3v2 unsycronisation()
- APE::Item::value(): use binaryData()
- APE::Item::toStringList(): use values()
- MPEG::ID3v2::Frame::Header::unsycronisation(): use unsynchronisation()
2023-12-11 06:35:08 +01:00
8b3f1a459e Fix issues reported by CppCheck
Many shadowFunction, some useStlAlgorithm, and others.

cppcheck --enable=all --inline-suppr \
  --suppress=noExplicitConstructor --suppress=unusedFunction \
  --suppress=missingIncludeSystem --project=compile_commands.json
2023-12-07 05:00:00 +01:00
9df243ef74 Separate multiple values in basic tag with " / " instead of " " 2023-12-01 06:22:35 +01:00
c1bb678695 Remove redundant UserTextIdentificationFrame::fieldList() 2023-12-01 06:22:35 +01:00
8bb8fc5fe6 Remove null byte removal for table of contents frame 2023-12-01 06:22:35 +01:00
8b564baf01 Make PropertyMap::unsupportedData() const 2023-12-01 06:22:35 +01:00
3d67b139e4 Fix extensibility of ID3v2 FrameFactory
Because the main extension point of FrameFactory was using a protected
Frame subclass, it was not really possible to implement a custom frame
factory. Existing Frame subclasses also show that access to the frame
header might be needed when implementing a Frame subclass.
2023-11-23 16:41:46 +01:00
59166f6757 ID3v2: Always pass correct FrameFactory from File to Tag 2023-11-23 16:41:46 +01:00
b7dc1ab8ac Fail MPEG header check when frame length is zero (#1174) 2023-11-23 16:41:13 +01:00
9679b08120 Verify type of ID3v2 frames used for complex properties (#1173)
A frame with ID "APIC" is not guaranteed to be an AttachedPictureFrame,
it can also be an invalid UnknownFrame with ID "APIC". Check the types
of the frames before accessing them.
2023-11-09 20:59:47 +01:00
0e395f4ec4 Use ID3v2::FrameFactory also for WAV and DSDIFF (#1172)
* Use ID3v2::FrameFactory also for WAV and DSDIFF

* Apply suggestions from code review

Co-authored-by: Kevin André <hyperquantum@gmail.com>

---------

Co-authored-by: Kevin André <hyperquantum@gmail.com>
2023-11-09 18:58:51 +01:00
3869aa189f Raw AAC (ADTS) support (#508)
Detect ADTS MPEG header to use it also for AAC.

The test file empty1s.aac was generated using
ffmpeg -f lavfi -i anullsrc=r=11025:cl=mono -t 1 -acodec aac empty1s.aac

---------

Co-authored-by: Nick Shaforostov <mshaforostov@airmusictech.com>
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2023-11-03 05:17:39 +01:00
6be03b7ae1 Unified interface for complex properties like pictures (#94)
Provides a dynamic interface for properties which cannot be represented
with simple strings, e.g. pictures. The keys of such properties can
be queried using `complexPropertyKeys()`, which could return for example
["PICTURE"]. The property can then be read using
`complexProperties("PICTURE")`, which will return a list of variant maps
containing the picture data and attributes. Adding a picture is as
easy as

    t->setComplexProperties("PICTURE", {
      {
        {"data", data},
        {"pictureType", "Front Cover"},
        {"mimeType", "image/jpeg"}
      }
    });
2023-10-14 09:01:59 +02:00
89a54863ee std::array conversion (#1157) 2023-10-09 17:09:27 +02:00
3f25d3c342 Proofreading (#1155)
---------

Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2023-10-08 05:58:33 +02:00