diff mbox series

[FFmpeg-devel] Revert "avfilter/vf_idet: reduce noisyness if the filter has been auto inserted"

Message ID AM7PR03MB6660043ED08CF28DC37020A88FB19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit f626a3d0e0e6c59af4e844c7e2d308a93ea8c3e2
Headers show
Series [FFmpeg-devel] Revert "avfilter/vf_idet: reduce noisyness if the filter has been auto inserted" | 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

Andreas Rheinhardt Oct. 7, 2021, 11:39 a.m. UTC
This reverts commit 723c37d3b7b5555f23bfdfe3e5c3599543c06332.
Said commit was in preparation for auto-inserting the idet filter.
This has never happened; even if it did, the code is wrong, because
it segfaults if the filter instance doesn't have a name (having one
is not mandatory). Furthermore, it is documented for libavfilter to
not assign any semantics to the name, which this check violates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
IMO the proper way to distinguish auto-inserted filters from
manually inserted filters is by adding a flag to AVFilterInternal.

 libavfilter/vf_idet.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Andreas Rheinhardt Oct. 10, 2021, 10:17 a.m. UTC | #1
Andreas Rheinhardt:
> This reverts commit 723c37d3b7b5555f23bfdfe3e5c3599543c06332.
> Said commit was in preparation for auto-inserting the idet filter.
> This has never happened; even if it did, the code is wrong, because
> it segfaults if the filter instance doesn't have a name (having one
> is not mandatory). Furthermore, it is documented for libavfilter to
> not assign any semantics to the name, which this check violates.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> IMO the proper way to distinguish auto-inserted filters from
> manually inserted filters is by adding a flag to AVFilterInternal.
> 
>  libavfilter/vf_idet.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
> index 8e7785fc55..0f3e78c4ec 100644
> --- a/libavfilter/vf_idet.c
> +++ b/libavfilter/vf_idet.c
> @@ -335,20 +335,19 @@ static int request_frame(AVFilterLink *link)
>  static av_cold void uninit(AVFilterContext *ctx)
>  {
>      IDETContext *idet = ctx->priv;
> -    int level = strncmp(ctx->name, "auto-inserted", 13) ? AV_LOG_INFO : AV_LOG_DEBUG;
>  
> -    av_log(ctx, level, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
> +    av_log(ctx, AV_LOG_INFO, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
>             idet->total_repeats[REPEAT_NONE],
>             idet->total_repeats[REPEAT_TOP],
>             idet->total_repeats[REPEAT_BOTTOM]
>          );
> -    av_log(ctx, level, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
> +    av_log(ctx, AV_LOG_INFO, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
>             idet->total_prestat[TFF],
>             idet->total_prestat[BFF],
>             idet->total_prestat[PROGRESSIVE],
>             idet->total_prestat[UNDETERMINED]
>          );
> -    av_log(ctx, level, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
> +    av_log(ctx, AV_LOG_INFO, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
>             idet->total_poststat[TFF],
>             idet->total_poststat[BFF],
>             idet->total_poststat[PROGRESSIVE],
> 

Will apply this tonight unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 8e7785fc55..0f3e78c4ec 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -335,20 +335,19 @@  static int request_frame(AVFilterLink *link)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     IDETContext *idet = ctx->priv;
-    int level = strncmp(ctx->name, "auto-inserted", 13) ? AV_LOG_INFO : AV_LOG_DEBUG;
 
-    av_log(ctx, level, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
+    av_log(ctx, AV_LOG_INFO, "Repeated Fields: Neither:%6"PRId64" Top:%6"PRId64" Bottom:%6"PRId64"\n",
            idet->total_repeats[REPEAT_NONE],
            idet->total_repeats[REPEAT_TOP],
            idet->total_repeats[REPEAT_BOTTOM]
         );
-    av_log(ctx, level, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
+    av_log(ctx, AV_LOG_INFO, "Single frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
            idet->total_prestat[TFF],
            idet->total_prestat[BFF],
            idet->total_prestat[PROGRESSIVE],
            idet->total_prestat[UNDETERMINED]
         );
-    av_log(ctx, level, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
+    av_log(ctx, AV_LOG_INFO, "Multi frame detection: TFF:%6"PRId64" BFF:%6"PRId64" Progressive:%6"PRId64" Undetermined:%6"PRId64"\n",
            idet->total_poststat[TFF],
            idet->total_poststat[BFF],
            idet->total_poststat[PROGRESSIVE],