Patch-Source: https://github.com/chimera-linux/cports/blob/493e4aa53465d9a3e083b1b6f69c7990f675c51b/main/ffmpeg/patches/v4l-ioctl.patch
--
commit 8a48dfff8f68f075d7277b21589de175b76493c1
Author: Daniel Kolesa <daniel@octaforge.org>
Date:   Sat Jun 17 15:33:56 2023 +0200

    unify ioctl interface with v4l2 on musl

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5e85d1a..ee4d362 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -31,6 +31,7 @@
  */
 
 #include <stdatomic.h>
+#include <stdarg.h>
 
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
@@ -107,11 +108,7 @@ struct video_data {
     int (*open_f)(const char *file, int oflag, ...);
     int (*close_f)(int fd);
     int (*dup_f)(int fd);
-#ifdef __GLIBC__
     int (*ioctl_f)(int fd, unsigned long int request, ...);
-#else
-    int (*ioctl_f)(int fd, int request, ...);
-#endif
     ssize_t (*read_f)(int fd, void *buffer, size_t n);
     void *(*mmap_f)(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
     int (*munmap_f)(void *_start, size_t length);
@@ -122,6 +119,18 @@ struct buff_data {
     int index;
 };
 
+/* ffs */
+static int ioctl_wrapper(int fd, unsigned long request, ...)
+{
+    void *arg;
+    va_list ap;
+    va_start(ap, request);
+    arg = va_arg(ap, void *);
+    va_end(ap);
+    return ioctl(fd, request, arg);
+}
+#define ioctl ioctl_wrapper
+
 static int device_open(AVFormatContext *ctx, const char* device_path)
 {
     struct video_data *s = ctx->priv_data;
