summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2022-11-10 13:33:36 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-16 15:44:35 +0000
commit309b09cb0a97afeb40bdab26ee04ca99a8dd1290 (patch)
tree26eaae01d4e3f2ad6897abaad7a9d099ce15c573 /src
parent0048b66b7d0890b11c78de907c119b4ee17214c3 (diff)
Fix camera ffmpeg crash
The commit just fixes typo made in one of recent commits. Tests on local PC get passed after the fix. Change-Id: I4e4adf5f0f039867f0ecad5130e072169ab91eac Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit be49af3b0f062fceef31711c67450ffbf595a808) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
index e5d90239b..ba6ba9136 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
@@ -298,8 +298,14 @@ AVHWDeviceType HWAccel::deviceType() const
void HWAccel::createFramesContext(AVPixelFormat swFormat, const QSize &size)
{
- if (m_hwDeviceContext)
+ if (m_hwFramesContext) {
+ qWarning() << "Frames context has been already created!";
return;
+ }
+
+ if (!m_hwDeviceContext)
+ return;
+
m_hwFramesContext = av_hwframe_ctx_alloc(m_hwDeviceContext);
auto *c = (AVHWFramesContext *)m_hwFramesContext->data;
c->format = hwFormat();