From 5638a2a1b70266e7417ce5b53bc1d0cdb5037d35 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 29 Sep 2014 12:02:12 +0000 Subject: reduced tag reading delay git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4519 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/flac/decoderflacfactory.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/plugins/Input/flac') 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 #include #include - +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include +#include +#endif #include "cueparser.h" #include "decoder_flac.h" #include "flacmetadatamodel.h" @@ -98,15 +101,27 @@ QList DecoderFLACFactory::createPlayList(const QString &fileName, bo return QList() << 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(); } -- cgit v1.2.3-13-gbd6f