From 2a807e98b235bc7198c08f6b7fe8c2b1cc2d834b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 18 Feb 2020 12:12:01 +0100 Subject: st/vdpau: Only call is_video_format_supported hook if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Namely only if *is_supported is true, otherwise the hook result can't affect it. Avoids ../src/gallium/state_trackers/vdpau/vdpau_private.h:138: FormatYCBCRToPipe: Assertion `0' failed. with assertions enabled. Fixes: 5d5b414a7b84 "st/vdpau: fix chroma_format handling in VideoSurfaceQueryGetPutBitsYCbCrCapabilities" Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Christian König Tested-by: Marge Bot Part-of: (cherry picked from commit 7e6010106fb3c4eb5436de869183e857243c1006) --- src/gallium/state_trackers/vdpau/query.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gallium/state_trackers/vdpau/query.c') diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index 5f644bbeea0..eca1b3031c1 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -154,13 +154,13 @@ vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(VdpDevice device, VdpChromaTyp break; } - *is_supported &= pscreen->is_video_format_supported - ( - pscreen, - FormatYCBCRToPipe(bits_ycbcr_format), - PIPE_VIDEO_PROFILE_UNKNOWN, - PIPE_VIDEO_ENTRYPOINT_BITSTREAM - ); + if (*is_supported && + !pscreen->is_video_format_supported(pscreen, + FormatYCBCRToPipe(bits_ycbcr_format), + PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM)) { + *is_supported = false; + } mtx_unlock(&dev->mutex); return VDP_STATUS_OK; -- cgit v1.2.1