diff mbox series

[FFmpeg-devel,4/4] avfilter/vf_transpose_vulkan: simplify config_props_output function

Message ID 20211210190503.4015128-4-jianhua.wu@intel.com
State Accepted
Commit f176669a374c16d45bb0b8464de3b8a73f791e2d
Headers show
Series [FFmpeg-devel,1/4] avfilter/vf_transpose_vulkan: add cclock option | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Wu Jianhua Dec. 10, 2021, 7:05 p.m. UTC
It's no need to assign outlink here, which has been done in
ff_vk_filter_config_output already.

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavfilter/vf_transpose_vulkan.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Lynne Dec. 10, 2021, 8:03 p.m. UTC | #1
10 Dec 2021, 20:05 by jianhua.wu@intel.com:

> It's no need to assign outlink here, which has been done in
> ff_vk_filter_config_output already.
>
> Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
> ---
>  libavfilter/vf_transpose_vulkan.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/libavfilter/vf_transpose_vulkan.c b/libavfilter/vf_transpose_vulkan.c
> index eceb9b9011..ce83cf0fd7 100644
> --- a/libavfilter/vf_transpose_vulkan.c
> +++ b/libavfilter/vf_transpose_vulkan.c
> @@ -262,7 +262,6 @@ static av_cold void transpose_vulkan_uninit(AVFilterContext *avctx)
>  
>  static int config_props_output(AVFilterLink *outlink)
>  {
> -    int err = 0;
>  AVFilterContext *avctx = outlink->src;
>  TransposeVulkanContext *s = avctx->priv;
>  FFVulkanContext *vkctx = &s->vkctx;
> @@ -271,21 +270,13 @@ static int config_props_output(AVFilterLink *outlink)
>  vkctx->output_width  = inlink->h;
>  vkctx->output_height = inlink->w;
>  
> -    RET(ff_vk_filter_config_output(outlink));
> -
> -    outlink->w = inlink->h;
> -    outlink->h = inlink->w;
> -
>  if (inlink->sample_aspect_ratio.num)
>  outlink->sample_aspect_ratio = av_div_q((AVRational) { 1, 1 },
>  inlink->sample_aspect_ratio);
>  else
>  outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
>  
> -    err = 0;
> -
> -fail:
> -    return err;
> +    return ff_vk_filter_config_output(outlink);
>  }
>  
>  #define OFFSET(x) offsetof(TransposeVulkanContext, x)
>

Tested, squashed the first 3 patches into one, and pushed this along with that one.
Thanks
diff mbox series

Patch

diff --git a/libavfilter/vf_transpose_vulkan.c b/libavfilter/vf_transpose_vulkan.c
index eceb9b9011..ce83cf0fd7 100644
--- a/libavfilter/vf_transpose_vulkan.c
+++ b/libavfilter/vf_transpose_vulkan.c
@@ -262,7 +262,6 @@  static av_cold void transpose_vulkan_uninit(AVFilterContext *avctx)
 
 static int config_props_output(AVFilterLink *outlink)
 {
-    int err = 0;
     AVFilterContext *avctx = outlink->src;
     TransposeVulkanContext *s = avctx->priv;
     FFVulkanContext *vkctx = &s->vkctx;
@@ -271,21 +270,13 @@  static int config_props_output(AVFilterLink *outlink)
     vkctx->output_width  = inlink->h;
     vkctx->output_height = inlink->w;
 
-    RET(ff_vk_filter_config_output(outlink));
-
-    outlink->w = inlink->h;
-    outlink->h = inlink->w;
-
     if (inlink->sample_aspect_ratio.num)
         outlink->sample_aspect_ratio = av_div_q((AVRational) { 1, 1 },
                                                 inlink->sample_aspect_ratio);
     else
         outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
 
-    err = 0;
-
-fail:
-    return err;
+    return ff_vk_filter_config_output(outlink);
 }
 
 #define OFFSET(x) offsetof(TransposeVulkanContext, x)