This changes the modifications from the last commit in order to
achieve the following behavior: MP4::File::save() works in the
same way as before, i.e. it will never shrink the file and will
make space from removed items available as padding in the form of
a "free" atom. To completely remove the "meta" atom from the file,
a new method strip() is introduced, which can be used in the same
way as its MPEG::File::strip() counterpart.
Currently, MP4 tags can only grow. If items are removed, they are
just replaced by padding in the form of "free" atoms. This change
will remove the whole "meta" atom when an MP4 tag without items
is saved. This will make it possible, to bring the file back to
its pristine state without metadata.
* clang-tidy: replace static_cast with dynamic_cast
Found with cppcoreguidelines-pro-type-static-cast-downcast
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* use std::pair instead of 2D C array
Mostly the same. Except there's now an association between both values.
make_pair has to be used since there's no uniform initialization.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The while loop in this function assumes that `data.end() - 1` is less
than `data.end()`, which isn't the case if `data` is empty since
`data.end()` can be a nullptr.
`pos`, `valLegnth`, and `data.size()` are all unsigned types so we have
to do a little dance to correctly bounds check them without overflow.
Without this we can get stuck in an infinite loop due to 'pos'
overflowing back to the start of the data.
Small line decrease, but also easier to read what is happening.
Now all dependencies can be read from the root CMakeLists.txt file.
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
BUILD_TESTING is default enabled, which is a good default anyway.
Move the CppUnit check to the root CMakeLists.txt, simpler and clearer.
BUILD_TESTS is obsolete.
The need for BUILD_SHARED_LIBS=OFF for testing is not clear, it works on Linux.
But I kept it in the instructions for now.
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
The change from "fileref: Use user defined resolvers on streams"
does not work with the Windows FileName implementation, and
TestFileRef::testFileResolver fails.
The support for MusicBrainz properties is enhanced with "ARTISTS", "ASIN",
"RELEASECOUNTRY", "RELEASESTATUS", "RELEASETYPE", "MUSICBRAINZ_RELEASETRACKID",
"ORIGINALDATE" on APE, ASF, MP4, ID3v2, and Xiph tags.