diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-09-29 12:02:12 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-09-29 12:02:12 +0000 |
| commit | 5638a2a1b70266e7417ce5b53bc1d0cdb5037d35 (patch) | |
| tree | c4b68971ead3ef69c7c1dc4123eb246c30ff5625 /src/plugins/Input/flac | |
| parent | 729eb1013bc4614f2eb259c59f51542b1bfb5bec (diff) | |
| download | qmmp-5638a2a1b70266e7417ce5b53bc1d0cdb5037d35.tar.gz qmmp-5638a2a1b70266e7417ce5b53bc1d0cdb5037d35.tar.bz2 qmmp-5638a2a1b70266e7417ce5b53bc1d0cdb5037d35.zip | |
reduced tag reading delay
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4519 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/flac')
| -rw-r--r-- | src/plugins/Input/flac/decoderflacfactory.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp index 7e2600b7d..af7b00dcf 100644 --- a/src/plugins/Input/flac/decoderflacfactory.cpp +++ b/src/plugins/Input/flac/decoderflacfactory.cpp @@ -25,7 +25,10 @@ #include <taglib/oggflacfile.h> #include <taglib/xiphcomment.h> #include <taglib/tmap.h> - +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> +#endif #include "cueparser.h" #include "decoder_flac.h" #include "flacmetadatamodel.h" @@ -98,15 +101,27 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo return QList<FileInfo *>() << info; } +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); +#endif + if(fileName.endsWith(".flac", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + flacFile = new TagLib::FLAC::File(&stream, TagLib::ID3v2::FrameFactory::instance()); +#else flacFile = new TagLib::FLAC::File(fileName.toLocal8Bit().constData()); +#endif tag = useMetaData ? flacFile->xiphComment() : 0; ap = flacFile->audioProperties(); } else if(fileName.endsWith(".oga", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + oggFlacFile = new TagLib::Ogg::FLAC::File(&stream); +#else oggFlacFile = new TagLib::Ogg::FLAC::File(fileName.toLocal8Bit().constData()); +#endif tag = useMetaData ? oggFlacFile->tag() : 0; ap = oggFlacFile->audioProperties(); } |
