diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-07-11 09:59:23 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-11 15:35:37 +0200 |
commit | 10c080521c525e1729b23dfa0afd08a1428f40d0 (patch) | |
tree | 851fa40f8dbee496826f0134a44e3dcd2a589a19 | |
parent | 6dc5f327adfa987d2c03db3506c761d77a62e013 (diff) | |
download | qtmultimedia-10c080521c525e1729b23dfa0afd08a1428f40d0.tar.gz |
Eradicate the last Q_FOREACH and mark the module clean
This one is not trivial in that it isn't clear, a priori, that the
loop body doesn't re-enter the class and ends up modifying
m_videoProbes.
But MFVideoProbeControl::bufferProbed() just schedules a deferred call
to QMediaVideoProbeControl::videoFrameProbed() (via QueuedConnection),
so this cannot happen, because we end the loop before we re-enter the
event loop (if any) on this thread. Reentrancy from a different thread,
OTOH, is not possible because we're holding m_videoProbeMutex while
looping.
Change-Id: I6c1e22cd01112f0b2650e056f0b7f4a392370b84
Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/plugins/wmf/player/mftvideo.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.qmake.conf b/.qmake.conf index 2c781f2ea..f6895bb09 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,5 +1,5 @@ load(qt_build_config) -DEFINES += QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST +DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST MODULE_VERSION = 5.14.0 diff --git a/src/plugins/wmf/player/mftvideo.cpp b/src/plugins/wmf/player/mftvideo.cpp index 747fe6aea..879911d55 100644 --- a/src/plugins/wmf/player/mftvideo.cpp +++ b/src/plugins/wmf/player/mftvideo.cpp @@ -573,7 +573,7 @@ STDMETHODIMP MFTransform::ProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, if (!m_videoProbes.isEmpty()) { QVideoFrame frame = makeVideoFrame(); - foreach (MFVideoProbeControl* probe, m_videoProbes) + for (MFVideoProbeControl* probe : qAsConst(m_videoProbes)) probe->bufferProbed(frame); } m_videoProbeMutex.unlock(); |