[vlc-commits] test: teletext: fix use of conditionals

Francois Cartegnie git at videolan.org
Wed Jun 17 12:44:35 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jun 17 11:36:20 2020 +0200| [eea583dbfde37a93f779403a6a6327d8ba84466b] | committer: Francois Cartegnie

test: teletext: fix use of conditionals

telx is also optional

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eea583dbfde37a93f779403a6a6327d8ba84466b
---

 configure.ac             |  6 ++++++
 test/Makefile.am         |  5 +++--
 test/src/player/player.c | 18 +++++++++++++-----
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 399d0695be..89fc36cdf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3171,6 +3171,7 @@ AS_IF( [test "${enable_zvbi}" != "no"],[
         [
           VLC_ADD_PLUGIN([zvbi])
           AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
+          have_zvbi="yes"
           AS_IF( [test "${enable_telx}" = "yes"],[
                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
                   ])
@@ -3178,9 +3179,14 @@ AS_IF( [test "${enable_zvbi}" != "no"],[
           AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
         ])
     ])
+AM_CONDITIONAL([HAVE_ZVBI], [test "x${have_zvbi}" = x"yes"])
+
 AS_IF( [test "${enable_telx}" != "no" ],[
   VLC_ADD_PLUGIN([telx])
+  have_telx="yes"
+  AC_DEFINE(TELX_COMPILED, 1, [Define if the telx module is built])
   ])
+AM_CONDITIONAL([HAVE_TELX], [test "x${have_telx}" = x"yes"])
 
 dnl
 dnl ARIB subtitles rendering module
diff --git a/test/Makefile.am b/test/Makefile.am
index 28b950db20..caa236ce70 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -270,9 +270,10 @@ libvlc_demux_dec_run_la_LIBADD += \
 	../modules/libtextst_plugin.la \
 	../modules/libsubstx3g_plugin.la
 endif
-if WITH_ZVBI
+if HAVE_ZVBI
 libvlc_demux_dec_run_la_LIBADD += ../modules/libzvbi_plugin.la
-else
+endif
+if HAVE_TELX
 libvlc_demux_dec_run_la_LIBADD += ../modules/libtelx_plugin.la
 endif
 EXTRA_LTLIBRARIES += libvlc_demux_dec_run.la
diff --git a/test/src/player/player.c b/test/src/player/player.c
index d43a9cf3e4..382065f775 100644
--- a/test/src/player/player.c
+++ b/test/src/player/player.c
@@ -27,10 +27,12 @@
 #include <vlc_player.h>
 #include <vlc_vector.h>
 
-#ifdef ZVBI_COMPILED
-# define TELETEXT_DECODER "zvbi"
+#if defined(ZVBI_COMPILED)
+# define TELETEXT_DECODER "zvbi,"
+#elif defined(TELX_COMPILED)
+# define TELETEXT_DECODER "telx,"
 #else
-# define TELETEXT_DECODER "telx"
+# define TELETEXT_DECODER ""
 #endif
 
 struct report_capabilities
@@ -2076,7 +2078,7 @@ ctx_init(struct ctx *ctx, bool use_outputs)
         "--no-media-library",
         "--no-drop-late-frames",
         /* Avoid leaks from various dlopen... */
-        "--codec=araw,rawvideo,subsdec,"TELETEXT_DECODER",none",
+        "--codec=araw,rawvideo,subsdec,"TELETEXT_DECODER"none",
         "--dec-dev=none",
         use_outputs ? "--vout=dummy" : "--vout=none",
         use_outputs ? "--aout=dummy" : "--aout=none",
@@ -2478,7 +2480,9 @@ test_timers(struct ctx *ctx)
 static void
 test_teletext(struct ctx *ctx)
 {
-    test_log("teletext\n");
+#if defined(ZVBI_COMPILED) || defined(TELX_COMPILED)
+    test_log("teletext with "TELETEXT_DECODER"\n");
+
     vlc_player_t *player = ctx->player;
     const struct vlc_player_track *track;
 
@@ -2714,6 +2718,10 @@ test_teletext(struct ctx *ctx)
     }
 
     test_end(ctx);
+#else
+    VLC_UNUSED(ctx);
+    test_log("teletext skipped\n");
+#endif
 }
 
 int



More information about the vlc-commits mailing list