[vlc-commits] [Git][videolan/vlc][master] 2 commits: ytdl: do not disable on Windows

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Dec 11 16:19:12 UTC 2025



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
47fc20c5 by Rémi Denis-Courmont at 2025-12-11T16:49:05+01:00
ytdl: do not disable on Windows

- - - - -
c6b6a008 by Rémi Denis-Courmont at 2025-12-11T16:49:05+01:00
ytdl: implement process termination on Windows

- - - - -


2 changed files:

- modules/demux/Makefile.am
- modules/demux/ytdl.c


Changes:

=====================================
modules/demux/Makefile.am
=====================================
@@ -540,13 +540,11 @@ TESTS += adaptive_test
 libytdl_plugin_la_SOURCES = demux/ytdl.c
 libytdl_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DEXEEXT=\"$(EXEEXT)\"
 libytdl_plugin_la_LIBADD = libvlc_json.la
-if !HAVE_WIN32
 if !HAVE_ANDROID
 if !HAVE_EMSCRIPTEN
 demux_LTLIBRARIES += libytdl_plugin.la
 endif
 endif
-endif
 
 libnoseek_plugin_la_SOURCES = demux/filter/noseek.c
 demux_LTLIBRARIES += libnoseek_plugin.la


=====================================
modules/demux/ytdl.c
=====================================
@@ -29,6 +29,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>         /* STDERR_FILENO */
+#ifdef _WIN32
+# include <processthreadsapi.h>
+#endif
 
 #include "json/json.h"
 #include <vlc_common.h>
@@ -89,6 +92,34 @@ static int ytdl_popen(pid_t *restrict pid, const char *argv[])
     return fds[0];
 }
 
+#ifdef _WIN32
+static int vlc_kill(pid_t pid, int signum)
+{
+    HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
+    BOOL res;
+
+    if (h == NULL) {
+        errno = ESRCH;
+        return -1;
+    }
+
+    if (signum > 0)
+        res = TerminateProcess(h, signum);
+    else
+        res = TRUE;
+
+    CloseHandle(h);
+
+    if (!res) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    return 0;
+}
+#define kill(p, s) vlc_kill(p, s)
+#endif
+
 struct ytdl_playlist {
     struct json_object json;
     stream_t *source;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cfaeefa7adbe50acccb7e21411263fc4aea382bb...c6b6a00872dfb7a3f4a33923b000540827e47aff

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


VideoLAN code repository instance


More information about the vlc-commits mailing list