SDL: fix pipewire camera interval fraction inversion

From 0ee874f02dde2cf8c3228df7b51aa1da36b0af27 Mon Sep 17 00:00:00 2001
From: Green Sky <[EMAIL REDACTED]>
Date: Wed, 15 May 2024 23:31:25 +0200
Subject: [PATCH] fix pipewire camera interval fraction inversion

SDL expects an interval fraction to be provided by the backend, but
pipewire provides a framerate fraction, we we just switch them.
---
 src/camera/pipewire/SDL_camera_pipewire.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/camera/pipewire/SDL_camera_pipewire.c b/src/camera/pipewire/SDL_camera_pipewire.c
index bc8959b19f359..79b668ac63c68 100644
--- a/src/camera/pipewire/SDL_camera_pipewire.c
+++ b/src/camera/pipewire/SDL_camera_pipewire.c
@@ -621,8 +621,9 @@ static void collect_rates(CameraFormatAddData *data, struct param *p, const Uint
 	SPA_FALLTHROUGH;
     case SPA_CHOICE_Enum:
 	for (i = 0; i < n_vals; i++) {
+            // denom and num are switched, because sdl expects an interval, while pw provides a rate
             if (SDL_AddCameraFormat(data, sdlfmt, size->width, size->height,
-				    rates[i].num, rates[i].denom) == -1) {
+				    rates[i].denom, rates[i].num) == -1) {
                 return;  // Probably out of memory; we'll go with what we have, if anything.
             }
 	}