summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-08 12:26:57 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-08 12:36:59 (GMT)
commit1dd1cb8c70a8986c1acc911a663d99d7043d15c7 (patch)
tree8f2fff29350221e88a63e1cad3ee8de28da447e8 /src/3rdparty
parent16d23fdced8577e9ad015fd9283373761b8464ef (diff)
downloadQt-1dd1cb8c70a8986c1acc911a663d99d7043d15c7.zip
Qt-1dd1cb8c70a8986c1acc911a663d99d7043d15c7.tar.gz
Qt-1dd1cb8c70a8986c1acc911a663d99d7043d15c7.tar.bz2
Phonon: Fixed a possible race condition
Task-number: 257495
Diffstat (limited to 'src/3rdparty')
-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 26ba8eb..f77bdc1 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;
+ }
}