From ae045ef3f6cea8028d8814bd48c59187e4bff485 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 11 Dec 2023 16:07:57 +0100 Subject: [PATCH] raop: use 1500ms of latency as fallback The Pro Link 1 replies with Audio-latency=0, patch that up to 1500ms to make it work again. Previously it configured 1500ms as the default latency but that seems unnecessary in the usual case. Fixes #3698 --- src/modules/module-raop-sink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index fee6d520b..ed5630ac0 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -153,6 +153,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME); #define RAOP_STRIDE (2*DEFAULT_CHANNELS) #define RAOP_RATE 44100 #define RAOP_LATENCY_MS 250 +#define DEFAULT_LATENCY_MS 1500 #define VOLUME_MAX 0.0 #define VOLUME_MIN -30.0 @@ -890,8 +891,11 @@ static int rtsp_record_reply(void *data, int status, const struct spa_dict *head if ((str = spa_dict_lookup(headers, "Audio-Latency")) != NULL) { uint32_t l; - if (spa_atou32(str, &l, 0)) + if (spa_atou32(str, &l, 0)) { + if (l == 0) + l = msec_to_samples(impl, DEFAULT_LATENCY_MS); impl->latency = SPA_MAX(l, impl->latency); + } } spa_zero(latency);