diff options
author | Jøger Hansegård <joger.hansegard@qt.io> | 2023-06-06 20:01:26 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-06-06 20:18:41 +0000 |
commit | 4f44e430d28db96a458cfc3326e25de59832f4f8 (patch) | |
tree | 9602f66989237b4943f9a6602934e15c59cefc5e | |
parent | be6b7a8f605a02c7c7b4fc9abb6fc1bd0470bfbc (diff) |
Avoid flooding log during DXGI screen capture error handling
Due to an error handling bug, the DXGI screen capture would flood the log
when facing lost duplication interface. This can happen for example when
pushing Ctr+Alt+Del while screen capturing is ongoing.
This change does not implement recovery after lost duplication interface,
but prevents flooding the log by avoiding repeatedly calling
IDXGIOutputDuplication::ReleaseFrame
Task-number: QTBUG-113460
Change-Id: Iad5761cc4cfe5189460944528b35fd136085631f
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 59a50bebb386c83a829ffabd7392c1de2bdb9f5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/multimedia/ffmpeg/qffmpegscreencapture_dxgi.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpegscreencapture_dxgi.cpp b/src/plugins/multimedia/ffmpeg/qffmpegscreencapture_dxgi.cpp index 7799f1a49..1c88e1c44 100644 --- a/src/plugins/multimedia/ffmpeg/qffmpegscreencapture_dxgi.cpp +++ b/src/plugins/multimedia/ffmpeg/qffmpegscreencapture_dxgi.cpp @@ -182,11 +182,11 @@ private: QMaybe<QComPtr<ID3D11Texture2D>> getNextFrame() { if (m_releaseFrame) { + m_releaseFrame = false; + HRESULT hr = m_duplication->ReleaseFrame(); if (FAILED(hr)) return "Failed to release duplication frame. " + ::errorString(hr); - - m_releaseFrame = false; } QComPtr<IDXGIResource> frame; |