diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index 9266f8ff9..ccc727eea 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -167,7 +167,7 @@ PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME); "( raop.encryption.type= ) " \ "( raop.audio.codec=PCM ) " \ "( raop.password= ) " \ - "( raop.latency.ms= ) " \ + "( raop.latency.ms= ) " \ "( node.latency= ) " \ "( node.name= ) " \ "( node.description= ) " \ @@ -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);