From b07de8a7f986275599db4a0177d659a3e882bcff Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 23 Jul 2014 18:01:21 +0200 Subject: [PATCH] vaapivideomemory: fix association of surface to proxy. Make sure to always update the VA surface pointer whenever the proxy changes. This used to only work when the VA surface is written to, in interop with SW element ("upload" feature), and this now fixes cases when the VA surface is needed for reading, in interop with SW element ("download" feature). --- gst/vaapi/gstvaapivideomemory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index b3f702a52d..0400fefb95 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -117,10 +117,9 @@ ensure_surface(GstVaapiVideoMemory *mem) return FALSE; gst_vaapi_video_meta_set_surface_proxy(mem->meta, mem->proxy); } - mem->surface = GST_VAAPI_SURFACE_PROXY_SURFACE(mem->proxy); } - g_return_val_if_fail(mem->surface != NULL, FALSE); - return TRUE; + mem->surface = GST_VAAPI_SURFACE_PROXY_SURFACE(mem->proxy); + return mem->surface != NULL; } gboolean