aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-04-25 06:44:05 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-04-25 06:44:05 +0000
commitbf0735a1b70ff1a6723a728cef32d3eb6ef96902 (patch)
tree3349c9d6b8422ad24613893bf1c1ccd848ae653d /src/plugins/Input/mad
parent0a4dd651536e614f3d623108cac870d4ee8635e6 (diff)
downloadqmmp-bf0735a1b70ff1a6723a728cef32d3eb6ef96902.tar.gz
qmmp-bf0735a1b70ff1a6723a728cef32d3eb6ef96902.tar.bz2
qmmp-bf0735a1b70ff1a6723a728cef32d3eb6ef96902.zip
fixed problem with non-latin characters in the file paths under windows
(#852) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6261 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad')
-rw-r--r--src/plugins/Input/mad/decodermadfactory.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp
index 826576773..3c1e68087 100644
--- a/src/plugins/Input/mad/decodermadfactory.cpp
+++ b/src/plugins/Input/mad/decodermadfactory.cpp
@@ -39,6 +39,12 @@
#include "decoder_mad.h"
#include "decodermadfactory.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
+
// DecoderMADFactory
DecoderMADFactory::DecoderMADFactory()
@@ -128,7 +134,7 @@ QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, boo
TagLib::Tag *tag = 0;
#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);
TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance());
#else
TagLib::MPEG::File fileRef(fileName.toLocal8Bit ().constData());