vaapivideobufferpool: reject configuration if allocator isn't vaapi
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 29 Jan 2020 10:55:39 +0000 (11:55 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 2 Feb 2020 16:22:43 +0000 (17:22 +0100)
If the requested allocator in set_config() is not a VAAPI valid one,
reject the configuration, instead of lying and using a private one.

This patch superseeds !254 and !24

gst/vaapi/gstvaapivideobufferpool.c

index a331d4f..d99f306 100644 (file)
@@ -166,14 +166,8 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
   if (allocator
       && (g_strcmp0 (allocator->mem_type, GST_VAAPI_VIDEO_MEMORY_NAME) != 0
           && g_strcmp0 (allocator->mem_type,
-              GST_VAAPI_DMABUF_ALLOCATOR_NAME) != 0)) {
-    /* if pool has already an allocator, try it and ignore the one in
-     * configuration */
-    if (priv->allocator)
-      allocator = priv->allocator;
-    else
-      allocator = NULL;
-  }
+              GST_VAAPI_DMABUF_ALLOCATOR_NAME) != 0))
+    goto error_invalid_allocator;
 
   /* get the allocator properties */
   if (allocator) {