diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-04-25 06:09:27 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-04-25 06:09:27 +0000 |
| commit | 0a4dd651536e614f3d623108cac870d4ee8635e6 (patch) | |
| tree | 764441454b79b7bf0177dbfd28a90a0a553bbf8c /src | |
| parent | 7aa5a39abb84f63bae5a5c1c84f5899aa18cee77 (diff) | |
| download | qmmp-0a4dd651536e614f3d623108cac870d4ee8635e6.tar.gz qmmp-0a4dd651536e614f3d623108cac870d4ee8635e6.tar.bz2 qmmp-0a4dd651536e614f3d623108cac870d4ee8635e6.zip | |
flac: fixed file path endcoding
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6260 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Input/flac/decoderflacfactory.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp index 3839af85e..f8378f588 100644 --- a/src/plugins/Input/flac/decoderflacfactory.cpp +++ b/src/plugins/Input/flac/decoderflacfactory.cpp @@ -34,6 +34,12 @@ #include "flacmetadatamodel.h" #include "decoderflacfactory.h" +#ifdef Q_OS_WIN +#define QStringToFileName(s) TagLib::FileName(reinterpret_cast<const wchar_t *>(s.utf16()) +#else +#define QStringToFileName(s) s.toLocal8Bit().constData() +#endif + // DecoderFLACFactory @@ -102,7 +108,7 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo } #if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::FileStream stream(QStringToFileName(fileName), true); #endif if(fileName.endsWith(".flac", Qt::CaseInsensitive)) @@ -110,7 +116,7 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo #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()); + flacFile = new TagLib::FLAC::File(QStringToFileName(fileName)); #endif tag = useMetaData ? flacFile->xiphComment() : 0; ap = flacFile->audioProperties(); |
