Skip to content

Commit 98ac2b9

Browse files
author
Mark Kendall
committed
VAAPI: Add some extra GLX locking.
1 parent f9c0b9a commit 98ac2b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mythtv/libs/libmythtv/vaapicontext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,11 @@ bool VAAPIContext::CopySurfaceToTexture(const void* buf, uint texture,
626626
else if (scan == kScan_Intr2ndField)
627627
field = VA_BOTTOM_FIELD;
628628

629+
m_display->m_x_disp->Lock();
629630
INIT_ST;
630631
va_status = vaCopySurfaceGLX(m_ctx.display, glx_surface, surf->m_id, field);
631632
CHECK_ST;
633+
m_display->m_x_disp->Unlock();
632634
return true;
633635
}
634636

@@ -637,6 +639,7 @@ void* VAAPIContext::GetGLXSurface(uint texture, uint texture_type)
637639
if (m_glxSurfaces.contains(texture))
638640
return m_glxSurfaces.value(texture);
639641

642+
MythXLocker locker(m_display->m_x_disp);
640643
void *glx_surface = NULL;
641644
INIT_ST;
642645
va_status = vaCreateSurfaceGLX(m_ctx.display, texture_type,
@@ -660,13 +663,12 @@ void VAAPIContext::ClearGLXSurfaces(void)
660663
if (!m_display)
661664
return;
662665

663-
m_display->m_x_disp->Lock();
666+
MythXLocker locker(m_display->m_x_disp);
664667
INIT_ST;
665668
foreach (void* surface, m_glxSurfaces)
666669
{
667670
va_status = vaDestroySurfaceGLX(m_ctx.display, surface);
668671
CHECK_ST;
669672
}
670673
m_glxSurfaces.clear();
671-
m_display->m_x_disp->Unlock();
672674
}

0 commit comments

Comments
 (0)