summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2022-11-10 13:33:36 +0100
committerArtem Dyomin <artem.dyomin@qt.io>2022-11-16 16:13:33 +0100
commitbe49af3b0f062fceef31711c67450ffbf595a808 (patch)
treec3bbc5cbab3215daa0c7981d21779e265c54b162 /src
parent77721ec69facafe3f3269bdd8a7fb6470587256d (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. Pick-to: 6.4 Change-Id: I4e4adf5f0f039867f0ecad5130e072169ab91eac Reviewed-by: Lars Knoll <lars@knoll.priv.no>
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 67759d5c6..faf28081a 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel.cpp
@@ -301,8 +301,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();