Commit 6ef2bb61 authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI-X11: suspend thread cancellation for these routines.

Make sure cancellation does not happen in these routines.
parent 7e7983e5
...@@ -562,9 +562,11 @@ void CloseVaapiX11(vlc_object_t *obj) ...@@ -562,9 +562,11 @@ void CloseVaapiX11(vlc_object_t *obj)
static void Manage(vout_display_t *vd) static void Manage(vout_display_t *vd)
{ {
int canc = vlc_savecancel();
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
xcb_connection_t *conn = XGetXCBConnection(sys->x11display); xcb_connection_t *conn = XGetXCBConnection(sys->x11display);
ManageEvent(vd, conn, &sys->visible); ManageEvent(vd, conn, &sys->visible);
vlc_restorecancel(canc);
} }
static int Control (vout_display_t *vd, int query, va_list ap) static int Control (vout_display_t *vd, int query, va_list ap)
...@@ -784,6 +786,7 @@ static vasubpicture_cache_t *cache_SubpictureCreate(vout_display_t *vd, const su ...@@ -784,6 +786,7 @@ static vasubpicture_cache_t *cache_SubpictureCreate(vout_display_t *vd, const su
const subpicture_region_t *region, const int flags) const subpicture_region_t *region, const int flags)
{ {
vout_display_sys_t *sys = (vout_display_sys_t *) vd->sys; vout_display_sys_t *sys = (vout_display_sys_t *) vd->sys;
int canc = vlc_savecancel();
sys->conn->lock(); sys->conn->lock();
...@@ -845,6 +848,7 @@ static vasubpicture_cache_t *cache_SubpictureCreate(vout_display_t *vd, const su ...@@ -845,6 +848,7 @@ static vasubpicture_cache_t *cache_SubpictureCreate(vout_display_t *vd, const su
vasub_cache->rect.i_height = region->fmt.i_visible_height; vasub_cache->rect.i_height = region->fmt.i_visible_height;
sys->conn->unlock(); sys->conn->unlock();
vlc_restorecancel(canc);
return vasub_cache; return vasub_cache;
cleanup: cleanup:
...@@ -857,6 +861,7 @@ cleanup: ...@@ -857,6 +861,7 @@ cleanup:
error: error:
sys->conn->unlock(); sys->conn->unlock();
vlc_restorecancel(canc);
return NULL; return NULL;
} }
...@@ -886,6 +891,8 @@ static void cache_SubpictureDestroy(vout_display_t *vd, vlc_va_conn_t *conn, sub ...@@ -886,6 +891,8 @@ static void cache_SubpictureDestroy(vout_display_t *vd, vlc_va_conn_t *conn, sub
assert(subpic->i_id != VA_INVALID_ID); assert(subpic->i_id != VA_INVALID_ID);
assert(subpic->image.image_id != VA_INVALID_ID); assert(subpic->image.image_id != VA_INVALID_ID);
int canc = vlc_savecancel();
conn->lock(); conn->lock();
vaDestroySubpicture(conn->p_display, subpic->i_id); vaDestroySubpicture(conn->p_display, subpic->i_id);
...@@ -897,6 +904,8 @@ static void cache_SubpictureDestroy(vout_display_t *vd, vlc_va_conn_t *conn, sub ...@@ -897,6 +904,8 @@ static void cache_SubpictureDestroy(vout_display_t *vd, vlc_va_conn_t *conn, sub
conn->unlock(); conn->unlock();
vlc_restorecancel(canc);
subpicture_cache_destroy(subpic); subpicture_cache_destroy(subpic);
subpic = NULL; subpic = NULL;
} }
...@@ -1320,6 +1329,7 @@ static void DisplayPicture(vout_display_t *vd, picture_t *picture, subpicture_t ...@@ -1320,6 +1329,7 @@ static void DisplayPicture(vout_display_t *vd, picture_t *picture, subpicture_t
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
int ret = VLC_EGENERIC; int ret = VLC_EGENERIC;
int canc = vlc_savecancel();
if (!sys->visible) if (!sys->visible)
goto out; goto out;
...@@ -1354,6 +1364,7 @@ out: ...@@ -1354,6 +1364,7 @@ out:
} }
picture_Release(picture); picture_Release(picture);
vlc_restorecancel(canc);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment