[vlc-commits] [Git][videolan/vlc][master] test: libvlc: fix build

Thomas Guillem gitlab at videolan.org
Wed Jun 2 10:42:16 UTC 2021



Thomas Guillem pushed to branch master at VideoLAN / VLC


Commits:
a1b7745f by Thomas Guillem at 2021-06-02T09:42:06+00:00
test: libvlc: fix build

Don't always include media utils functions that need linkage to VLCCORE.

Fixes #25777

- - - - -


5 changed files:

- test/Makefile.am
- + test/libvlc/media_utils.h
- test/libvlc/meta.c
- test/libvlc/slaves.c
- test/libvlc/test.h


Changes:

=====================================
test/Makefile.am
=====================================
@@ -70,7 +70,7 @@ EXTRA_DIST = \
 	samples/slaves \
 	$(check_SCRIPTS)
 
-check_HEADERS = libvlc/test.h libvlc/libvlc_additions.h
+check_HEADERS = libvlc/test.h libvlc/libvlc_additions.h libvlc/media_utils.h
 
 TESTS = $(check_PROGRAMS) check_POTFILES.sh
 


=====================================
test/libvlc/media_utils.h
=====================================
@@ -0,0 +1,48 @@
+/*
+ * media_utils.h - media utils function
+ */
+
+/**********************************************************************
+ *  Copyright (C) 2021 VLC authors and VideoLAN                       *
+ *  This program is free software; you can redistribute and/or modify *
+ *  it under the terms of the GNU General Public License as published *
+ *  by the Free Software Foundation; version 2 of the license, or (at *
+ *  your option) any later version.                                   *
+ *                                                                    *
+ *  This program is distributed in the hope that it will be useful,   *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of    *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.              *
+ *  See the GNU General Public License for more details.              *
+ *                                                                    *
+ *  You should have received a copy of the GNU General Public License *
+ *  along with this program; if not, you can get it from:             *
+ *  http://www.gnu.org/copyleft/gpl.html                              *
+ **********************************************************************/
+
+static void
+libvlc_media_parse_finished_event(const libvlc_event_t *p_ev, void *p_data)
+{
+    (void) p_ev;
+    vlc_sem_t *p_sem = p_data;
+    vlc_sem_post(p_sem);
+}
+
+static inline void
+libvlc_media_parse_sync(libvlc_media_t *p_m, libvlc_media_parse_flag_t parse_flag,
+                        int timeout)
+{
+    vlc_sem_t sem;
+    vlc_sem_init(&sem, 0);
+
+    libvlc_event_manager_t *p_em = libvlc_media_event_manager(p_m);
+    libvlc_event_attach(p_em, libvlc_MediaParsedChanged,
+                        libvlc_media_parse_finished_event, &sem);
+
+    int i_ret = libvlc_media_parse_with_options(p_m, parse_flag, timeout);
+    assert(i_ret == 0);
+
+    vlc_sem_wait (&sem);
+
+    libvlc_event_detach(p_em, libvlc_MediaParsedChanged,
+                        libvlc_media_parse_finished_event, &sem);
+}


=====================================
test/libvlc/meta.c
=====================================
@@ -24,6 +24,7 @@
 #include <string.h>
 
 #include "test.h"
+#include "media_utils.h"
 
 static void test_meta (const char ** argv, int argc)
 {


=====================================
test/libvlc/slaves.c
=====================================
@@ -19,6 +19,7 @@
  *****************************************************************************/
 
 #include "test.h"
+#include "media_utils.h"
 
 #define SLAVES_DIR SRCDIR "/samples/slaves"
 


=====================================
test/libvlc/test.h
=====================================
@@ -99,32 +99,4 @@ static inline void test_init (void)
     setenv( "VLC_PLUGIN_PATH", "../modules", 1 );
 }
 
-static void
-libvlc_media_parse_finished_event(const libvlc_event_t *p_ev, void *p_data)
-{
-    (void) p_ev;
-    vlc_sem_t *p_sem = p_data;
-    vlc_sem_post(p_sem);
-}
-
-static inline void
-libvlc_media_parse_sync(libvlc_media_t *p_m, libvlc_media_parse_flag_t parse_flag,
-                        int timeout)
-{
-    vlc_sem_t sem;
-    vlc_sem_init(&sem, 0);
-
-    libvlc_event_manager_t *p_em = libvlc_media_event_manager(p_m);
-    libvlc_event_attach(p_em, libvlc_MediaParsedChanged,
-                        libvlc_media_parse_finished_event, &sem);
-
-    int i_ret = libvlc_media_parse_with_options(p_m, parse_flag, timeout);
-    assert(i_ret == 0);
-
-    vlc_sem_wait (&sem);
-
-    libvlc_event_detach(p_em, libvlc_MediaParsedChanged,
-                        libvlc_media_parse_finished_event, &sem);
-}
-
 #endif /* TEST_H */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a1b7745f21cf9d8614e702c99f5ad216a945b9a6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a1b7745f21cf9d8614e702c99f5ad216a945b9a6
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list