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:
committed by
The Qt Project
parent
a23b14874c
commit
99c4a08c38
@@ -125,7 +125,12 @@ void MFAudioDecoderControl::setSourceFilename(const QString &fileName)
|
|||||||
if (!m_sourceFilename.isEmpty()) {
|
if (!m_sourceFilename.isEmpty()) {
|
||||||
m_sourceResolver->shutdown();
|
m_sourceResolver->shutdown();
|
||||||
QMediaResourceList rl;
|
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_sourceResolver->load(rl, 0);
|
||||||
m_loadingSource = true;
|
m_loadingSource = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user