Skip to content

Commit

Permalink
Fix deadlock in QAVDemuxer::unload
Browse files Browse the repository at this point in the history
  • Loading branch information
valbok committed Oct 29, 2023
1 parent 5864861 commit 874aef4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/QtAVPlayer/qavdemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ extern "C" {
}
#endif

#include <QAtomicInt>
#include <QDir>
#include <QSharedPointer>
#include <QMutexLocker>
#include <atomic>
#include <QDebug>

extern "C" {
Expand All @@ -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;
Expand All @@ -92,7 +92,6 @@ class QAVDemuxerPrivate
static int decode_interrupt_cb(void *ctx)
{
auto d = reinterpret_cast<QAVDemuxerPrivate *>(ctx);
QMutexLocker locker(&d->mutex);
return d ? int(d->abortRequest) : 0;
}

Expand Down

0 comments on commit 874aef4

Please sign in to comment.