diff options
Diffstat (limited to 'taglib/mp4/mp4file.cpp')
-rw-r--r-- | taglib/mp4/mp4file.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp index 3733fb40..5ad8396d 100644 --- a/taglib/mp4/mp4file.cpp +++ b/taglib/mp4/mp4file.cpp @@ -26,6 +26,8 @@ #include <tdebug.h> #include <tstring.h> #include <tpropertymap.h> +#include <tagutils.h> + #include "mp4atom.h" #include "mp4tag.h" #include "mp4file.h" @@ -69,6 +71,22 @@ public: MP4::Properties *properties; }; +//////////////////////////////////////////////////////////////////////////////// +// static members +//////////////////////////////////////////////////////////////////////////////// + +bool MP4::File::isSupported(IOStream *stream) +{ + // An MP4 file has to have an "ftyp" box first. + + const ByteVector id = Utils::readHeader(stream, 8, false); + return id.containsAt("ftyp", 4); +} + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + MP4::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : TagLib::File(file), d(new FilePrivate()) |