va: baseenc: Do not import the VA surface from other display.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
This commit is contained in:
He Junyan 2022-11-04 21:52:39 +08:00
parent d51b29b1dc
commit 1881d1826a

View file

@ -238,7 +238,8 @@ _try_import_buffer (GstVaBaseEnc * base, GstBuffer * inbuf)
/* The VA buffer. */
surface = gst_va_buffer_get_surface (inbuf);
if (surface != VA_INVALID_ID)
if (surface != VA_INVALID_ID &&
(gst_va_buffer_peek_display (inbuf) == base->display))
return TRUE;
/* TODO: DMA buffer. */