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>
This commit is contained in:
Yoann Lopes
2013-10-11 18:33:45 +02:00
committed by The Qt Project
parent a23b14874c
commit 99c4a08c38

View File

@@ -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 {