diff mbox series

[FFmpeg-devel,10/10] avfilter/avfiltergraph: Remove dead checks

Message ID AM7PR03MB6660DB8C44A634242B12BAD98FFC9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 3969c2abfb29c230cfce2ebfdcaaf6d0f0266b30
Headers show
Series [FFmpeg-devel,01/10] fftools/cmdutils: Use avfilter_pad_count() for AVFilter's number of pads | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 15, 2021, 9:55 a.m. UTC
These checks emit warnings in case the channel layouts lists are
inconsistent; yet since 69f5f6ea375950b4845b241ee27054bfc8f00343
a function that is called earlier errors out if they are inconsistent.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
This relies on no audio parts being set for video links, but this is
indeed so since the last commit.

 libavfilter/avfiltergraph.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

Comments

Nicolas George Aug. 20, 2021, 9:23 a.m. UTC | #1
Andreas Rheinhardt (12021-08-15):
> These checks emit warnings in case the channel layouts lists are
> inconsistent; yet since 69f5f6ea375950b4845b241ee27054bfc8f00343
> a function that is called earlier errors out if they are inconsistent.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> This relies on no audio parts being set for video links, but this is
> indeed so since the last commit.
> 
>  libavfilter/avfiltergraph.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)

Looks ok.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 41a91a9bda..4f11d9a029 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -295,21 +295,6 @@  AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *nam
     return NULL;
 }
 
-static void sanitize_channel_layouts(void *log, AVFilterChannelLayouts *l)
-{
-    if (!l)
-        return;
-    if (l->nb_channel_layouts) {
-        if (l->all_layouts || l->all_counts)
-            av_log(log, AV_LOG_WARNING, "All layouts set on non-empty list\n");
-        l->all_layouts = l->all_counts = 0;
-    } else {
-        if (l->all_counts && !l->all_layouts)
-            av_log(log, AV_LOG_WARNING, "All counts without all layouts\n");
-        l->all_layouts = 1;
-    }
-}
-
 static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterFormatsConfig *cfg)
 {
     int ret;
@@ -359,7 +344,7 @@  static int filter_check_formats(AVFilterContext *ctx)
 
 static int filter_query_formats(AVFilterContext *ctx)
 {
-    int ret, i;
+    int ret;
     AVFilterFormats *formats;
     AVFilterChannelLayouts *chlayouts;
     enum AVMediaType type = ctx->inputs  && ctx->inputs [0] ? ctx->inputs [0]->type :
@@ -376,11 +361,6 @@  static int filter_query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    for (i = 0; i < ctx->nb_inputs; i++)
-        sanitize_channel_layouts(ctx, ctx->inputs[i]->outcfg.channel_layouts);
-    for (i = 0; i < ctx->nb_outputs; i++)
-        sanitize_channel_layouts(ctx, ctx->outputs[i]->incfg.channel_layouts);
-
     formats = ff_all_formats(type);
     if ((ret = ff_set_common_formats(ctx, formats)) < 0)
         return ret;