Files
buildroot/package/mjpg-streamer/0003-output_viewer-fix-build-with-gcc-14.patch
Bernd Kuhls af4eef1e0f package/mjpg-streamer: fix build with gcc >= 14
When mjpg-streamer is built with gcc >= 14 using libjpeg (rather than
jpeg-turbo), and with SDL is enabled (to enable the output_viewer),
the compilation can fail with error:

    output_viewer.c:125:32: error: assignment to ‘boolean (*)(struct jpeg_decompress_struct *)’ from incompatible pointer type ‘int (*)(struct jpeg_decompress_struct *)’ [-Wincompatible-pointer-types]

The issue can be reproduced with the commands:

    cat >.config <<EOF
    BR2_aarch64=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
    BR2_PACKAGE_LIBJPEG=y
    BR2_PACKAGE_MJPG_STREAMER=y
    BR2_PACKAGE_SDL=y
    EOF
    make olddefconfig
    make mjpg-streamer

This commit adds a patch to fix this issue.

Fixes:
https://autobuild.buildroot.net/results/3a5/3a5674e4e7bb3f2894575191af24598e2a696912/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
[Julien: add commands to reproduce the issue]
Signed-off-by: Julien Olivain <ju.o@free.fr>
2025-10-19 15:37:35 +02:00

35 lines
1.2 KiB
Diff

From c0656c6a538739635441b165b4f1ba7c22c68b1d Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Sat, 18 Oct 2025 18:54:36 +0200
Subject: [PATCH] output_viewer: fix build with gcc >= 14
Fixes build error found by buildroot autobuilders:
output_viewer.c:125:32: error: assignment to 'boolean (*)(struct jpeg_decompress_struct *)'
from incompatible pointer type 'int (*)(struct jpeg_decompress_struct *)'
[-Wincompatible-pointer-types]
Upstream: https://github.com/jacksonliam/mjpg-streamer/pull/420
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
.../plugins/output_viewer/output_viewer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mjpg-streamer-experimental/plugins/output_viewer/output_viewer.c b/mjpg-streamer-experimental/plugins/output_viewer/output_viewer.c
index dd6c55b..c50f701 100644
--- a/mjpg-streamer-experimental/plugins/output_viewer/output_viewer.c
+++ b/mjpg-streamer-experimental/plugins/output_viewer/output_viewer.c
@@ -86,7 +86,7 @@ static void init_source(j_decompress_ptr cinfo)
return;
}
-static int fill_input_buffer(j_decompress_ptr cinfo)
+static boolean fill_input_buffer(j_decompress_ptr cinfo)
{
my_source_mgr * src = (my_source_mgr *) cinfo->src;
--
2.47.3