diff options
Diffstat (limited to 'taglib/ogg/vorbis/vorbisfile.cpp')
-rw-r--r-- | taglib/ogg/vorbis/vorbisfile.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/taglib/ogg/vorbis/vorbisfile.cpp b/taglib/ogg/vorbis/vorbisfile.cpp index 2773bd3b..b4f221ab 100644 --- a/taglib/ogg/vorbis/vorbisfile.cpp +++ b/taglib/ogg/vorbis/vorbisfile.cpp @@ -28,10 +28,10 @@ #include <tstring.h> #include <tdebug.h> #include <tpropertymap.h> +#include <tagutils.h> #include "vorbisfile.h" - using namespace TagLib; class Vorbis::File::FilePrivate @@ -60,6 +60,18 @@ namespace TagLib { } //////////////////////////////////////////////////////////////////////////////// +// static members +//////////////////////////////////////////////////////////////////////////////// + +bool Vorbis::File::isSupported(IOStream *stream) +{ + // An Ogg Vorbis file has IDs "OggS" and "\x01vorbis" somewhere. + + const ByteVector buffer = Utils::readHeader(stream, bufferSize(), false); + return (buffer.find("OggS") >= 0 && buffer.find("\x01vorbis") >= 0); +} + +//////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// |