[FFmpeg-cvslog] avfilter/vf_convolution: Fix compilation with sobel disabled

Andreas Rheinhardt git at videolan.org
Wed May 8 01:04:12 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun May  5 14:58:31 2024 +0200| [3c7dc9ea59c2ca113e28a2ac4c8143f27acddd01] | committer: Andreas Rheinhardt

avfilter/vf_convolution: Fix compilation with sobel disabled

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c7dc9ea59c2ca113e28a2ac4c8143f27acddd01
---

 libavfilter/convolution.h    | 2 +-
 libavfilter/vf_convolution.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/convolution.h b/libavfilter/convolution.h
index ee7477ef89..1196c1fcdf 100644
--- a/libavfilter/convolution.h
+++ b/libavfilter/convolution.h
@@ -119,7 +119,7 @@ static void filter16_sobel(uint8_t *dstp, int width,
     }
 }
 
-static av_unused void ff_sobel_init(ConvolutionContext *s, int depth, int nb_planes)
+static inline void ff_sobel_init(ConvolutionContext *s, int depth, int nb_planes)
 {
     for (int i = 0; i < 4; i++) {
         s->filter[i] = filter_sobel;
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
index d516db3717..bb78e33d80 100644
--- a/libavfilter/vf_convolution.c
+++ b/libavfilter/vf_convolution.c
@@ -761,8 +761,10 @@ static int param_init(AVFilterContext *ctx)
             s->rdiv[i] = s->scale;
             s->bias[i] = s->delta;
         }
+#if CONFIG_SOBEL_FILTER
     } else if (!strcmp(ctx->filter->name, "sobel")) {
         ff_sobel_init(s, s->depth, s->nb_planes);
+#endif
     } else if (!strcmp(ctx->filter->name, "kirsch")) {
         for (i = 0; i < 4; i++) {
             s->filter[i] = filter_kirsch;



More information about the ffmpeg-cvslog mailing list