diff mbox series

[FFmpeg-devel] avfilter/avfiltergraph: fix illogical flaws in code

Message ID CAPYw7P6MJCqcTHDP_Q0fDqpgJZptEe6CkijgOoHnXfyZaC9HKw@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avfilter/avfiltergraph: fix illogical flaws in code | expand

Checks

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

Commit Message

Paul B Mahol May 12, 2023, 8:49 p.m. UTC
Attached.

Comments

James Almer May 13, 2023, 1:04 a.m. UTC | #1
On 5/12/2023 5:49 PM, Paul B Mahol wrote:
> Attached.

> From 11907ee612b0440faeb3804e8f9af5e36a63db89 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Fri, 12 May 2023 21:01:41 +0200
> Subject: [PATCH] avfilter/avfiltergraph: fix illogical flaws in code
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/avfiltergraph.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index 53f468494d..744f480e1d 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -748,8 +748,10 @@ static int reduce_formats_on_filter(AVFilterContext *filter)
>                  (KNOWN(fmt) || fmts->all_counts)) {
>                  /* Turn the infinite list into a singleton */
>                  fmts->all_layouts = fmts->all_counts  = 0;
> -                if (ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt) < 0)
> -                    ret = 1;
> +                ret = ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt);
> +                if (ret < 0)
> +                    return ret;
> +                ret = 1;
>                  break;
>              }

Probably ok.
Paul B Mahol May 13, 2023, 7:02 a.m. UTC | #2
Will apply, as it makes less frustrated filtergraphs with no excessive
aformat filters for cases that can negotiate formats fully.
Addresses #6638 ticket too.
Anton Khirnov May 13, 2023, 7:55 a.m. UTC | #3
Quoting Paul B Mahol (2023-05-12 22:49:07)
> Attached.
> 
> From 11907ee612b0440faeb3804e8f9af5e36a63db89 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda@gmail.com>
> Date: Fri, 12 May 2023 21:01:41 +0200
> Subject: [PATCH] avfilter/avfiltergraph: fix illogical flaws in code

This commit message is useless. It should say what is the actual problem
that is being fixed.
diff mbox series

Patch

From 11907ee612b0440faeb3804e8f9af5e36a63db89 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Fri, 12 May 2023 21:01:41 +0200
Subject: [PATCH] avfilter/avfiltergraph: fix illogical flaws in code

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/avfiltergraph.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 53f468494d..744f480e1d 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -748,8 +748,10 @@  static int reduce_formats_on_filter(AVFilterContext *filter)
                 (KNOWN(fmt) || fmts->all_counts)) {
                 /* Turn the infinite list into a singleton */
                 fmts->all_layouts = fmts->all_counts  = 0;
-                if (ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt) < 0)
-                    ret = 1;
+                ret = ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt);
+                if (ret < 0)
+                    return ret;
+                ret = 1;
                 break;
             }
 
-- 
2.39.1