summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-10-11 18:33:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-14 18:44:03 +0200
commit99c4a08c38df23fa2dd0828369f55f2ad6431d7f (patch)
tree92dea91f63882e85465d34d7eea60c323774c2af
parenta23b14874cc0482e6700592d19dd2018aeb41cc5 (diff)
WMF: allow to set a qrc file name as source of a QAudioDecoder.
Task-number: QTBUG-33518 Change-Id: I01d8a1fa7b9a1c3ea2af9de6033dff2773cd6ace Reviewed-by: Christian Stromme <christian.stromme@digia.com>
-rw-r--r--src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
index 4de9dde0d..22eb1a09c 100644
--- a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
+++ b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
@@ -125,7 +125,12 @@ void MFAudioDecoderControl::setSourceFilename(const QString &fileName)
if (!m_sourceFilename.isEmpty()) {
m_sourceResolver->shutdown();
QMediaResourceList rl;
- rl.push_back(QMediaResource(QUrl::fromLocalFile(m_sourceFilename)));
+ QUrl url;
+ if (m_sourceFilename.startsWith(':'))
+ url = QUrl(QStringLiteral("qrc%1").arg(m_sourceFilename));
+ else
+ url = QUrl::fromLocalFile(m_sourceFilename);
+ rl.push_back(QMediaResource(url));
m_sourceResolver->load(rl, 0);
m_loadingSource = true;
} else {