module-rtp: fix sender latency

The sender should ask for a latency that matches the packet size, not
the playout latency, that is for the receiver only.
This commit is contained in:
Wim Taymans 2023-03-10 17:29:43 +01:00
parent 7c9ce63795
commit f3230ca2e6

View file

@ -362,8 +362,13 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
impl->max_error = msec_to_samples(impl, ERROR_MSEC); impl->max_error = msec_to_samples(impl, ERROR_MSEC);
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", impl->rate); pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", impl->rate);
pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d", if (direction == PW_DIRECTION_INPUT) {
impl->target_buffer / 2, impl->rate); pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d",
impl->psamples, impl->rate);
} else {
pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d",
impl->target_buffer / 2, impl->rate);
}
pw_properties_setf(props, "net.mtu", "%u", impl->mtu); pw_properties_setf(props, "net.mtu", "%u", impl->mtu);
pw_properties_setf(props, "rtp.ptime", "%u", pw_properties_setf(props, "rtp.ptime", "%u",