Skip to content

Commit

Permalink
Merge branch 'jb48607' into 'master'
Browse files Browse the repository at this point in the history
Fixing deadlock in event processing

See merge request mer-core/nemo-qtmultimedia-plugins!10
  • Loading branch information
rainemak committed Jan 29, 2020
2 parents 6fd518c + a1e77f8 commit 956bcad
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/videotexturebackend/videotexturebackend.cpp
Expand Up @@ -771,15 +771,17 @@ QRectF NemoVideoTextureBackend::adjustedViewport() const
bool NemoVideoTextureBackend::event(QEvent *event)
{
if (event->type() == QEvent::Resize) {
QMutexLocker locker(&m_mutex);
m_nativeSize = static_cast<QResizeEvent *>(event)->size();
if (m_nativeSize.isValid()) {
if ((m_orientation % 180) != 0) {
m_nativeSize.transpose();
QSize nativeSize = static_cast<QResizeEvent *>(event)->size();
if (nativeSize.isValid()) {
{
QMutexLocker locker(&m_mutex);
m_nativeSize = nativeSize;
if ((m_orientation % 180) != 0) {
m_nativeSize.transpose();
}
}

static_cast<ImplicitSizeVideoOutput *>(q)->setImplicitSize(
m_nativeSize.width(), m_nativeSize.height());
nativeSize.width(), nativeSize.height());
}
q->update();
emit nativeSizeChanged();
Expand All @@ -797,6 +799,8 @@ void NemoVideoTextureBackend::frame_ready(GstElement *, int frame, void *data)
NemoVideoTextureBackend *instance = static_cast<NemoVideoTextureBackend *>(data);

if (frame < 0) {
QMutexLocker locker(&instance->m_mutex);

instance->m_active = false;
} else {
QMutexLocker locker(&instance->m_mutex);
Expand Down

0 comments on commit 956bcad

Please sign in to comment.