d3d11download: Fix decide_allocation
authorSeungha Yang <seungha@centricular.com>
Sun, 13 Feb 2022 13:39:46 +0000 (22:39 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 14 Feb 2022 10:48:31 +0000 (10:48 +0000)
Caps should be parsed in any cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1691>

subprojects/gst-plugins-bad/sys/d3d11/gstd3d11download.cpp

index c7e9c5f..20a7bcb 100644 (file)
@@ -269,26 +269,24 @@ gst_d3d11_download_decide_allocation (GstBaseTransform * trans,
   gboolean has_videometa;
   GstCaps *outcaps = NULL;
 
+  gst_query_parse_allocation (query, &outcaps, NULL);
+
+  if (!outcaps)
+    return FALSE;
+
   if (gst_query_get_n_allocation_pools (query) > 0) {
     gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
 
-    if (!pool)
-      gst_query_parse_allocation (query, &outcaps, NULL);
-
     update_pool = TRUE;
   } else {
     GstVideoInfo vinfo;
 
-    gst_query_parse_allocation (query, &outcaps, NULL);
     gst_video_info_from_caps (&vinfo, outcaps);
     size = vinfo.size;
     min = max = 0;
     update_pool = FALSE;
   }
 
-  if (!outcaps)
-    return FALSE;
-
   has_videometa = gst_query_find_allocation_meta (query,
       GST_VIDEO_META_API_TYPE, nullptr);