return;
}
+ // must have a moov atom, otherwise consider it invalid
+ MP4::Atom *moov = d->atoms->find("moov");
+ if(!moov) {
+ setValid(false);
+ return;
+ }
+
d->tag = new Tag(this, d->atoms);
if(readProperties) {
d->properties = new Properties(this, d->atoms, audioPropertiesStyle);
CPPUNIT_TEST_SUITE(TestMP4);
CPPUNIT_TEST(testProperties);
CPPUNIT_TEST(testFreeForm);
+ CPPUNIT_TEST(testCheckValid);
CPPUNIT_TEST(testUpdateStco);
CPPUNIT_TEST(testSaveExisingWhenIlstIsLast);
CPPUNIT_TEST(test64BitAtom);
CPPUNIT_ASSERT_EQUAL(16, ((MP4::Properties *)f.audioProperties())->bitsPerSample());
}
+ void testCheckValid()
+ {
+ MP4::File f("data/empty.aiff");
+ CPPUNIT_ASSERT(!f.isValid());
+ MP4::File f2("data/has-tags.m4a");
+ CPPUNIT_ASSERT(f2.isValid());
+ }
+
void testUpdateStco()
{
ScopedFileCopy copy("no-tags", ".3g2");