From 76ce83801ade3ac922ad5ba6fddc49764c24206a Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 10 Sep 2024 13:05:48 -0700
Subject: [PATCH] Removed pipewire client version check
@smcv may have found the root cause of the pipewire thread crash, so removing the pipewire client version check to re-enable use of pipewire in older container runtimes.
---
src/audio/pipewire/SDL_pipewire.c | 42 ++++++++-----------------------
1 file changed, 10 insertions(+), 32 deletions(-)
diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c
index 49249b1cdae7b..fa58a5c12b03d 100644
--- a/src/audio/pipewire/SDL_pipewire.c
+++ b/src/audio/pipewire/SDL_pipewire.c
@@ -247,29 +247,17 @@ static int hotplug_init_seq_val;
static bool hotplug_init_complete;
static bool hotplug_events_enabled;
-static int pipewire_core_version_major = 0;
-static int pipewire_core_version_minor = 0;
-static int pipewire_core_version_patch = 0;
-
-static int pipewire_client_version_major = 0;
-static int pipewire_client_version_minor = 0;
-static int pipewire_client_version_patch = 0;
-
+static int pipewire_version_major;
+static int pipewire_version_minor;
+static int pipewire_version_patch;
static char *pipewire_default_sink_id = NULL;
static char *pipewire_default_source_id = NULL;
static bool pipewire_core_version_at_least(int major, int minor, int patch)
{
- return (pipewire_core_version_major >= major) &&
- (pipewire_core_version_major > major || pipewire_core_version_minor >= minor) &&
- (pipewire_core_version_major > major || pipewire_core_version_minor > minor || pipewire_core_version_patch >= patch);
-}
-
-static bool pipewire_client_version_at_least(int major, int minor, int patch)
-{
- return (pipewire_client_version_major >= major) &&
- (pipewire_client_version_major > major || pipewire_client_version_minor >= minor) &&
- (pipewire_client_version_major > major || pipewire_client_version_minor > minor || pipewire_client_version_patch >= patch);
+ return (pipewire_version_major >= major) &&
+ (pipewire_version_major > major || pipewire_version_minor >= minor) &&
+ (pipewire_version_major > major || pipewire_version_minor > minor || pipewire_version_patch >= patch);
}
// The active node list
@@ -420,10 +408,10 @@ static void core_events_hotplug_init_callback(void *object, uint32_t id, int seq
static void core_events_hotplug_info_callback(void *data, const struct pw_core_info *info)
{
- if (SDL_sscanf(info->version, "%d.%d.%d", &pipewire_core_version_major, &pipewire_core_version_minor, &pipewire_core_version_patch) < 3) {
- pipewire_core_version_major = 0;
- pipewire_core_version_minor = 0;
- pipewire_core_version_patch = 0;
+ if (SDL_sscanf(info->version, "%d.%d.%d", &pipewire_version_major, &pipewire_version_minor, &pipewire_version_patch) < 3) {
+ pipewire_version_major = 0;
+ pipewire_version_minor = 0;
+ pipewire_version_patch = 0;
}
}
@@ -1241,16 +1229,6 @@ static bool PipewireInitialize(SDL_AudioDriverImpl *impl)
pipewire_initialized = true;
- if (SDL_sscanf(PIPEWIRE_pw_get_library_version(), "%d.%d.%d", &pipewire_client_version_major, &pipewire_client_version_minor, &pipewire_client_version_patch) < 3) {
- PIPEWIRE_Deinitialize();
- return false;
- }
-
- if (!pipewire_client_version_at_least(1, 0, 0)) {
- PIPEWIRE_Deinitialize();
- return false;
- }
-
if (!hotplug_loop_init()) {
hotplug_loop_destroy();
PIPEWIRE_Deinitialize();