diff options
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(); } |
