diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-03 10:34:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-05-03 09:24:36 +0000 |
commit | 1afe2ed975a71e72f37a34a9561dede342985be7 (patch) | |
tree | 85e0cae6770a34df16fa2807f4ce32054b4ab4b0 | |
parent | 6dc5ff99ac02a5ed2c716a011c06eee766d125de (diff) |
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>
-rw-r--r-- | src/plugins/directshow/player/directshowplayerservice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp index 73279accb..57f100b9c 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -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(); } |