mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-05 07:15:34 -04:00
module-rtp: don't confuse time and samples
Round down the target_buffer size to a psamples multiple. Don't try to mix time and sample units for this. Fixes #4327
This commit is contained in:
parent
73488ee338
commit
b5a9974795
1 changed files with 1 additions and 1 deletions
|
|
@ -518,7 +518,7 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
||||||
if (fmodf(impl->target_buffer, impl->psamples) != 0) {
|
if (fmodf(impl->target_buffer, impl->psamples) != 0) {
|
||||||
pw_log_warn("sess.latency.msec %f should be an integer multiple of rtp.ptime %f",
|
pw_log_warn("sess.latency.msec %f should be an integer multiple of rtp.ptime %f",
|
||||||
latency_msec, ptime);
|
latency_msec, ptime);
|
||||||
impl->target_buffer = (uint32_t)((impl->target_buffer / ptime) * impl->psamples);
|
impl->target_buffer = SPA_ROUND_DOWN(impl->target_buffer, impl->psamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", impl->rate);
|
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", impl->rate);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue