From 509e769aa5d04a025393f287dfc912a0e9f72978 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 9 Jan 2025 11:38:07 +0100 Subject: [PATCH] core: inherit the default.clock.quantum-limit from the server Copy the server value to the context so that the locally allocated buffers match the server quantum-limit and we don't cause xruns because of too small buffers. See #4490 --- src/pipewire/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pipewire/core.c b/src/pipewire/core.c index 91328a27f..3eb6d7bb6 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -23,6 +23,18 @@ PW_LOG_TOPIC_EXTERN(log_core); #define PW_LOG_TOPIC_DEFAULT log_core +static void core_event_info(void *data, const struct pw_core_info *info) +{ + struct pw_core *this = data; + if (info && info->props) { + static const char * const keys[] = { + "default.clock.quantum-limit", + NULL + }; + pw_properties_update_keys(this->context->properties, info->props, keys); + } +} + static void core_event_ping(void *data, uint32_t id, int seq) { struct pw_core *this = data; @@ -114,6 +126,7 @@ static void core_event_remove_mem(void *data, uint32_t id) static const struct pw_core_events core_events = { PW_VERSION_CORE_EVENTS, + .info = core_event_info, .error = core_event_error, .ping = core_event_ping, .done = core_event_done,