[vlc-devel] [PATCH 3/4] tests: player: use flags for context params

Francois Cartegnie fcvlcdev at free.fr
Tue Jul 7 13:43:23 CEST 2020


---
 test/src/player/player.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/src/player/player.c b/test/src/player/player.c
index 90707a88d2..4d405dbb6d 100644
--- a/test/src/player/player.c
+++ b/test/src/player/player.c
@@ -2067,8 +2067,14 @@ REPORT_LIST
     libvlc_release(ctx->vlc);
 }
 
+enum ctx_flags
+{
+    DISABLE_VIDEO_OUTPUT = 1 << 0,
+    DISABLE_AUDIO_OUTPUT = 1 << 1,
+};
+
 static void
-ctx_init(struct ctx *ctx, bool use_outputs)
+ctx_init(struct ctx *ctx, enum ctx_flags flags)
 {
     const char * argv[] = {
         "-v",
@@ -2079,8 +2085,8 @@ ctx_init(struct ctx *ctx, bool use_outputs)
         /* Avoid leaks from various dlopen... */
         "--codec=araw,rawvideo,subsdec,"TELETEXT_DECODER"none",
         "--dec-dev=none",
-        use_outputs ? "--vout=dummy" : "--vout=none",
-        use_outputs ? "--aout=dummy" : "--aout=none",
+        (flags & DISABLE_VIDEO_OUTPUT) ? "--vout=none" : "--vout=dummy",
+        (flags & DISABLE_AUDIO_OUTPUT) ? "--aout=none" : "--aout=dummy",
     };
     libvlc_instance_t *vlc = libvlc_new(ARRAY_SIZE(argv), argv);
     assert(vlc);
@@ -2731,10 +2737,10 @@ main(void)
     struct ctx ctx;
 
     /* Test with --aout=none --vout=none */
-    ctx_init(&ctx, false);
+    ctx_init(&ctx, DISABLE_VIDEO_OUTPUT | DISABLE_AUDIO_OUTPUT);
     test_no_outputs(&ctx);
     ctx_destroy(&ctx);
-    ctx_init(&ctx, true);
+    ctx_init(&ctx, 0);
 
     test_outputs(&ctx); /* Must be the first test */
 
-- 
2.25.4



More information about the vlc-devel mailing list