Add MP4::File::strip() to remove meta atom from file

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.
This commit is contained in:
Urs Fleisch
2021-12-29 20:54:18 +01:00
parent 2cb7973162
commit c4a0855f42
5 changed files with 65 additions and 14 deletions

View File

@ -673,10 +673,8 @@ public:
MP4::File f(copy.fileName().c_str());
CPPUNIT_ASSERT(f.isValid());
CPPUNIT_ASSERT(f.hasMP4Tag());
MP4::Tag *tag = f.tag();
CPPUNIT_ASSERT(!tag->isEmpty());
tag->setTitle("");
f.save();
CPPUNIT_ASSERT(!f.tag()->isEmpty());
f.strip();
}
{
MP4::File f(copy.fileName().c_str());