From 874aef4e3e06b412c0a2f2d589e351a7e78de2d5 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Sun, 29 Oct 2023 11:24:35 +0100 Subject: [PATCH] Fix deadlock in QAVDemuxer::unload --- src/QtAVPlayer/qavdemuxer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/QtAVPlayer/qavdemuxer.cpp b/src/QtAVPlayer/qavdemuxer.cpp index 23fd7467..307b7b77 100644 --- a/src/QtAVPlayer/qavdemuxer.cpp +++ b/src/QtAVPlayer/qavdemuxer.cpp @@ -41,10 +41,10 @@ extern "C" { } #endif -#include #include #include #include +#include #include extern "C" { @@ -71,7 +71,7 @@ class QAVDemuxerPrivate AVFormatContext *ctx = nullptr; AVBSFContext *bsf_ctx = nullptr; - bool abortRequest = false; + std::atomic_bool abortRequest = false; mutable QMutex mutex; bool seekable = false; @@ -92,7 +92,6 @@ class QAVDemuxerPrivate static int decode_interrupt_cb(void *ctx) { auto d = reinterpret_cast(ctx); - QMutexLocker locker(&d->mutex); return d ? int(d->abortRequest) : 0; }