diff --git a/cmdutils.c b/cmdutils.c
index 202b288a602f2cf852325cb732d8e4ba8958085f..96b40f31a64f9c04b754018d18bd9efdcba76793 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1161,12 +1161,14 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
 
 int show_filters(void *optctx, const char *opt, const char *arg)
 {
-    const AVFilter av_unused(*filter) = NULL;
+#if CONFIG_AVFILTER
+    const AVFilter *filter = NULL;
 
     printf("Filters:\n");
-#if CONFIG_AVFILTER
     while ((filter = avfilter_next(filter)))
         printf("%-16s %s\n", filter->name, filter->description);
+#else
+    printf("No filters available: libavfilter disabled\n");
 #endif
     return 0;
 }