[vlc-devel] [PATCH] config: display unknown options

Alexandre Janniaux ajanni at videolabs.io
Mon Sep 21 12:53:09 CEST 2020


When an unknown option is requested, the assertion triggers on the null
configuration variable, but the name of the missing variable is not
displayed.

While it's (sometimes) possible to display it through debugger or
additional code, the assertion is very usual and the message is
especially useful when debugging mobile devices or using libvlc without
being a core developer.
---
 src/config/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/config/core.c b/src/config/core.c
index ce05d20afd..48be3f39c2 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -116,6 +116,11 @@ char *config_GetPsz(const char *psz_name)
 
     p_config = config_FindConfig( psz_name );
 
+#ifndef NDEBUG
+    if (p_config == NULL)
+        fprintf(stderr, "Unknown vlc configuration variable named %s\n", psz_name);
+#endif
+
     /* sanity checks */
     assert(p_config != NULL);
     assert(IsConfigStringType (p_config->i_type));
-- 
2.28.0



More information about the vlc-devel mailing list