summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2017-10-11 17:05:53 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-11-10 10:11:34 +0000
commit4a214b199337a02e8cab77aa0cdca0c2805fb6a2 (patch)
tree9aab076dd062790a6f6d4704997d5edbb64c77b8 /src
parentb0c352054e64b0fc64e547bf54dad1bdeaee283a (diff)
Fix deadlock when a new url is set in loading state
Setting a new url while QMediaPlayer is in loading state can result in a deadlock between the GUI and worker thread. Because main thread is waiting when worker realeses m_graph but worker cleared all pending tasks and is waiting for new tasks from main thread. Task-number: QTBUG-53534 Change-Id: I296ecdf866c5d85efc7121d3e7936334d6b700fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/directshow/player/directshowplayerservice.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp
index 9cbb6296..8ee5d67a 100644
--- a/src/plugins/directshow/player/directshowplayerservice.cpp
+++ b/src/plugins/directshow/player/directshowplayerservice.cpp
@@ -402,7 +402,6 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
} else if (!m_resources.isEmpty()) {
m_pendingTasks |= SetUrlSource;
} else {
- m_pendingTasks = 0;
m_graphStatus = InvalidMedia;
switch (hr) {
@@ -1688,8 +1687,6 @@ void DirectShowPlayerService::run()
QMutexLocker locker(&m_mutex);
for (;;) {
- ::ResetEvent(m_taskHandle);
-
while (m_pendingTasks == 0) {
DWORD result = 0;