Skip to content

Commit

Permalink
Merge pull request #412 from valbok/atomic-abort
Browse files Browse the repository at this point in the history
Fix deadlock in QAVDemuxer::unload
  • Loading branch information
valbok committed Oct 29, 2023
2 parents 5864861 + 874aef4 commit 64d39e0
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 64d39e0

Please sign in to comment.