SDL: camera: make things work on older PipeWire

From f3d79ad75fdf9cda732d361e7af269f5037a5a69 Mon Sep 17 00:00:00 2001
From: Wim Taymans <[EMAIL REDACTED]>
Date: Thu, 9 May 2024 21:13:00 +0200
Subject: [PATCH] camera: make things work on older PipeWire

---
 src/camera/pipewire/SDL_camera_pipewire.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/camera/pipewire/SDL_camera_pipewire.c b/src/camera/pipewire/SDL_camera_pipewire.c
index e63b86735b97c..f24dca131917a 100644
--- a/src/camera/pipewire/SDL_camera_pipewire.c
+++ b/src/camera/pipewire/SDL_camera_pipewire.c
@@ -356,7 +356,7 @@ static void param_update(struct spa_list *param_list, struct spa_list *pending_l
     }
 }
 
-static struct {
+static struct sdl_video_format {
 	Uint32 format;
 	uint32_t id;
 } sdl_video_formats[] = {
@@ -390,7 +390,8 @@ static struct {
 
 static inline uint32_t sdl_format_to_id(Uint32 format)
 {
-	SPA_FOR_EACH_ELEMENT_VAR(sdl_video_formats, f) {
+	struct sdl_video_format *f;
+	SPA_FOR_EACH_ELEMENT(sdl_video_formats, f) {
 		if (f->format == format)
 			return f->id;
 	}
@@ -399,7 +400,8 @@ static inline uint32_t sdl_format_to_id(Uint32 format)
 
 static inline Uint32 id_to_sdl_format(uint32_t id)
 {
-	SPA_FOR_EACH_ELEMENT_VAR(sdl_video_formats, f) {
+	struct sdl_video_format *f;
+	SPA_FOR_EACH_ELEMENT(sdl_video_formats, f) {
 		if (f->id == id)
 			return f->format;
 	}