DirectShow: Invoke IGraphBuilder::AddSourceFilter() with local file name.
When possible, convert the URL to a local file name with native separators. The method seems to accept URLs with file scheme, but fails when passing UNC paths. Task-number: QTBUG-53114 Change-Id: Ib7418090080be8c1b8472e77541e686adaa3a18a Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
#include <QtCore/qdatetime.h>
|
||||
#include <QtCore/qdir.h>
|
||||
#include <QtCore/qthread.h>
|
||||
#include <QtCore/qvarlengtharray.h>
|
||||
|
||||
@@ -333,8 +334,10 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
|
||||
|
||||
if (!SUCCEEDED(hr)) {
|
||||
locker->unlock();
|
||||
const QString urlString = m_url.isLocalFile()
|
||||
? QDir::toNativeSeparators(m_url.toLocalFile()) : m_url.toString();
|
||||
hr = m_graph->AddSourceFilter(
|
||||
reinterpret_cast<const OLECHAR *>(m_url.toString().utf16()), L"Source", &source);
|
||||
reinterpret_cast<const OLECHAR *>(urlString.utf16()), L"Source", &source);
|
||||
locker->relock();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user