summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-08 14:26:57 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-08 14:36:59 +0200
commit1dd1cb8c70a8986c1acc911a663d99d7043d15c7 (patch)
tree8f2fff29350221e88a63e1cad3ee8de28da447e8 /src
parent16d23fdced8577e9ad015fd9283373761b8464ef (diff)
Phonon: Fixed a possible race condition
Task-number: 257495
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp
index 26ba8eb344..f77bdc1612 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.cpp
+++ b/src/3rdparty/phonon/ds9/mediaobject.cpp
@@ -207,12 +207,14 @@ namespace Phonon
HRESULT hr = S_OK;
- QMutexLocker locker(&m_mutex);
- m_currentRender = w.graph;
- m_currentRenderId = w.id;
- if (w.task == ReplaceGraph) {
- HANDLE h;
+ {
+ QMutexLocker locker(&m_mutex);
+ m_currentRender = w.graph;
+ m_currentRenderId = w.id;
+ }
+ if (w.task == ReplaceGraph) {
+ QMutexLocker locker(&m_mutex);
int index = -1;
for(int i = 0; i < FILTER_COUNT; ++i) {
if (m_graphHandle[i].graph == w.oldGraph) {
@@ -228,6 +230,7 @@ namespace Phonon
Q_ASSERT(index != -1);
//add the new graph
+ HANDLE h;
if (SUCCEEDED(ComPointer<IMediaEvent>(w.graph, IID_IMediaEvent)
->GetEventHandle(reinterpret_cast<OAEVENT*>(&h)))) {
m_graphHandle[index].graph = w.graph;
@@ -324,8 +327,11 @@ namespace Phonon
}
}
- m_currentRender = Graph();
- m_currentRenderId = 0;
+ {
+ QMutexLocker locker(&m_mutex);
+ m_currentRender = Graph();
+ m_currentRenderId = 0;
+ }
}