diff mbox series

[FFmpeg-devel,4/4] avcodec/vulkan_decode: Remove always-false check

Message ID GV1SPRMB00526EA8FB8A56FE48AB7C688F202@GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit ccb432c1fe651e64d1ae6ca02f5d2ad0e966c311
Headers show
Series [FFmpeg-devel] avcodec/vulkan_video: Remove unused array | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 7, 2024, 12:32 a.m. UTC
These fields are set for all Vulkan decoding hwaccels;
they would be useless if it were different.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vulkan_decode.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Lynne March 7, 2024, 4:03 a.m. UTC | #1
Mar 7, 2024, 01:33 by andreas.rheinhardt@outlook.com:

> These fields are set for all Vulkan decoding hwaccels;
> they would be useless if it were different.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/vulkan_decode.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
> index 233b5792d8..91929d165f 100644
> --- a/libavcodec/vulkan_decode.c
> +++ b/libavcodec/vulkan_decode.c
> @@ -780,11 +780,7 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
>  VkVideoFormatPropertiesKHR *ret_info;
>  uint32_t nb_out_fmts = 0;
>  
> -    if (!vk_desc->decode_op || !vk_desc->decode_extension) {
> -        av_log(avctx, AV_LOG_ERROR, "Unsupported codec for Vulkan decoding: %s!\n",
> -               avcodec_get_name(avctx->codec_id));
> -        return AVERROR(ENOSYS);
> -    } else if (!(vk_desc->decode_extension & ctx->s.extensions)) {
> +    if (!(vk_desc->decode_extension & ctx->s.extensions)) {
>  av_log(avctx, AV_LOG_ERROR, "Device does not support decoding %s!\n",
>  avcodec_get_name(avctx->codec_id));
>  return AVERROR(ENOSYS);
>

Patchset LGTM
Thanks for the cleanups
diff mbox series

Patch

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 233b5792d8..91929d165f 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -780,11 +780,7 @@  static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
     VkVideoFormatPropertiesKHR *ret_info;
     uint32_t nb_out_fmts = 0;
 
-    if (!vk_desc->decode_op || !vk_desc->decode_extension) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported codec for Vulkan decoding: %s!\n",
-               avcodec_get_name(avctx->codec_id));
-        return AVERROR(ENOSYS);
-    } else if (!(vk_desc->decode_extension & ctx->s.extensions)) {
+    if (!(vk_desc->decode_extension & ctx->s.extensions)) {
         av_log(avctx, AV_LOG_ERROR, "Device does not support decoding %s!\n",
                avcodec_get_name(avctx->codec_id));
         return AVERROR(ENOSYS);