vaapivideomemory: fix association of surface to proxy.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 23 Jul 2014 16:01:21 +0000 (18:01 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 23 Jul 2014 16:01:21 +0000 (18:01 +0200)
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

index b3f702a..0400fef 100644 (file)
@@ -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