From 27246ebeb0349b978ced98171dd024af864ef950 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 13 Feb 2022 22:39:46 +0900 Subject: [PATCH] d3d11download: Fix decide_allocation Caps should be parsed in any cases. Part-of: --- .../gst-plugins-bad/sys/d3d11/gstd3d11download.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11download.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11download.cpp index c7e9c5f53a..20a7bcb4de 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11download.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11download.cpp @@ -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);