Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deadlock in QAVDemuxer::unload #412

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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