The following user-settable values for CMake are supported:
- TESTS_DIR: Tests directory, is path to unit test data when 'data' is
appended. Can be used to run the unit tests on a target.
- TESTS_TMPDIR: Directory for temporary files created during unit tests,
system tmpdir is used if undefined. Has to be defined on systems
without global temporary directory.
* Add Shorten (SHN) support
* Add `<cmath>` include and use `std::log2`
* Use `uintptr_t` for buffer size calculations
* Work around `byteSwap` not using fixed width types
* Remove four-character codes
* Attempt to fix `static_assert`
* Revert previous commit
* Update `read_uint`* functions
* Use ByteVector for byte swaps
* Use different ByteVector ctor
* Rework variable-length input to use ByteVector
* Rename some variables
* Naming and formatting cleanup
* Add basic Shorten tests
* Rename a constant
* Rename `internalFileType` to `fileType`
* Add documentation on `fileType` meaning
* Add DO_NOT_DOCUMENT guard
* Fix shadowVariable issues reported by cppcheck
cppcheck --enable=all --inline-suppr \
--suppress=noExplicitConstructor --suppress=unusedFunction \
--suppress=missingIncludeSystem --project=compile_commands.json
* Formatting cleanup
* More explicit types
Reason for these changes: getRiceGolombCode(k, uInt32CodeSize) was
called with int k for uint32_t& argument.
There was also a warning from MSVC for line 299:
warning C4267: 'argument': conversion from 'size_t' to 'int'
* Additional explicit types
* Rename `SHN` namespace to `Shorten`
Also rename files to match
---------
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
If an M4A file contains trailing garbage (e.g. an APE tag at the
end of the file), it was considered invalid since [e21640b].
It is important to make sure that atoms which affect modifications
written by TagLib are valid, otherwise the file might be damaged.
However, in cases where invalid atoms do not affect modifications
(which are only done inside the root level "moov" and "moof"
containers), they can be safely ignored.
This commit allows trailing garbage in M4A files as it is also
accepted in MP3, WAV and DSF files.
Many shadowFunction, some useStlAlgorithm, and others.
cppcheck --enable=all --inline-suppr \
--suppress=noExplicitConstructor --suppress=unusedFunction \
--suppress=missingIncludeSystem --project=compile_commands.json
When calling setAutoDelete() on the implicitly shared copy of a list,
also auto-deletion of the original container was modified because
it was not detached. On the other hand, detach() was called by some
methods getting an Iterator parameter, which can lead to modification
of other implicitly shared copies but not the object is was called on.
This happens when the method is called on a not-already-detached
container, which is normally not the case because the container is
detached when the iterator is taken (e.g. calling begin()).
In such methods detach() cannot be called, and the client must
make sure that the iterator is taken after making an implicit copy.
This will NOT work:
List<int> l1 = { 1 };
auto it = l1.begin();
List<int> l2 = l1;
l1.erase(it);
This will modify both l1 and l2. The second and the third lines
must be swapped so that l1.begin() will detach l1 from l2.
The frames in a frameList() copy were not deleted because it had the
autoDelete property active. However, removed frames cannot be auto
deleted. Using setAutoDelete() affects the source of the copy, which has
to be investigated further.
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.
With specially crafted WAV files having the "id3 " chunk as the
only valid chunk, when trying to write the tags, the existing
"id3 " chunk is removed, and then vector::front() is called on
the now empty chunks vector.
Now it is checked if the vector is empty to avoid the crash.
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>
In order to achieve this, the TagLib_File type of the C bindings is now
a FileRef and no longer a File. The support for the .oga extension has been
ported to FileRef(), so that taglib_file_new() should still behave the
same, but additionally also support content based file type detection.
Use of FileRef::file() is discouraged, but was necessary to access the
properties. It was also not clear whether to access the properties via
tag() or file(). With the property methods on FileRef, it should become
the "simple usage" interface it was meant to be.
As the destructor was the only virtual method on FileRef, it is now made
non-virtual. Probably, it is not useful as a virtual base class.
Also modernize and simplify code, fix formatting, support
ID3v2FrameFactory, fix updating the internal chunk bookkeeping
after file modifications, stripping ID3 and DIIN tags.