raop: use default 1500ms latency again

Use 1500ms as the default latency and use the raop.latency.ms to
configure a smaller value.

Fixes #3605
This commit is contained in:
Wim Taymans 2023-12-11 16:33:51 +01:00
parent cda2522384
commit e4d6cca32a

View file

@ -167,7 +167,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
"( raop.encryption.type=<encryption, default:none> ) " \
"( raop.audio.codec=PCM ) " \
"( raop.password=<password for auth> ) " \
"( raop.latency.ms=<min latency in ms, default:"SPA_STRINGIFY(RAOP_LATENCY_MS)"> ) " \
"( raop.latency.ms=<min latency in ms, default:"SPA_STRINGIFY(DEFAULT_LATENCY_MS)"> ) " \
"( node.latency=<latency as fraction> ) " \
"( node.name=<name of the nodes> ) " \
"( node.description=<description of the nodes> ) " \
@ -892,11 +892,8 @@ 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 (l == 0)
l = msec_to_samples(impl, DEFAULT_LATENCY_MS);
if (spa_atou32(str, &l, 0))
impl->latency = SPA_MAX(l, impl->latency);
}
}
spa_zero(latency);
@ -1854,8 +1851,9 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
impl->mtu = impl->stride * impl->psamples;
impl->sync_period = impl->rate / impl->psamples;
if ((str = pw_properties_get(props, "raop.latency.ms")) != NULL)
impl->latency = SPA_MAX(impl->latency, msec_to_samples(impl, atoi(str)));
if ((str = pw_properties_get(props, "raop.latency.ms")) == NULL)
str = SPA_STRINGIFY(DEFAULT_LATENCY_MS);
impl->latency = SPA_MAX(impl->latency, msec_to_samples(impl, atoi(str)));
if (pw_properties_get(props, PW_KEY_AUDIO_FORMAT) == NULL)
pw_properties_setf(props, PW_KEY_AUDIO_FORMAT, "%s", RAOP_FORMAT);