using namespace TagLib;
-const char *MP4::Atom::containers[10] = {
+const char *MP4::Atom::containers[11] = {
"moov", "udta", "mdia", "meta", "ilst",
"stbl", "minf", "moof", "traf", "trak",
+ "stsd"
};
MP4::Atom::Atom(File *file)
if(name == "meta") {
file->seek(4, File::Current);
}
+ else if(name == "stsd") {
+ file->seek(8, File::Current);
+ }
while(file->tell() < offset + length) {
MP4::Atom *child = new MP4::Atom(file);
children.append(child);
TagLib::ByteVector name;
AtomList children;
private:
- static const int numContainers = 10;
- static const char *containers[10];
+ static const int numContainers = 11;
+ static const char *containers[11];
};
//! Root-level atoms
class MP4::Properties::PropertiesPrivate
{
public:
- PropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), bitsPerSample(0) {}
+ PropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), bitsPerSample(0), encrypted(false) {}
int length;
int bitrate;
int sampleRate;
int channels;
int bitsPerSample;
+ bool encrypted;
};
MP4::Properties::Properties(File *file, MP4::Atoms *atoms, ReadStyle style)
}
}
}
+
+ MP4::Atom *drms = atom->find("drms");
+ if(drms) {
+ d->encrypted = true;
+ }
}
MP4::Properties::~Properties()
return d->bitsPerSample;
}
+bool
+MP4::Properties::isEncrypted() const
+{
+ return d->encrypted;
+}
+
#endif
virtual int sampleRate() const;
virtual int channels() const;
virtual int bitsPerSample() const;
+ bool isEncrypted() const;
private:
class PropertiesPrivate;