diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c index 811b0b210..c7b10c665 100644 --- a/src/audio/pipewire/SDL_pipewire.c +++ b/src/audio/pipewire/SDL_pipewire.c @@ -31,6 +31,14 @@ #include #include +/* Older versions of Pipewire may not define this, but it's safe to pass at + * runtime even if older installations don't recognize it. + * Taken from src/pipewire/keys.h + */ +#ifndef PW_KEY_NODE_RATE +#define PW_KEY_NODE_RATE "node.rate" +#endif + /* * These seem to be sane limits as Pipewire * uses them in several of it's own modules. @@ -1110,6 +1118,7 @@ PIPEWIRE_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_NAME, stream_name); PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_DESCRIPTION, stream_name); PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%i", adjusted_samples, this->spec.freq); + PIPEWIRE_pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", this->spec.freq); PIPEWIRE_pw_properties_set(props, PW_KEY_NODE_ALWAYS_PROCESS, "true"); /*