modules: fix rate update

Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
This commit is contained in:
Wim Taymans 2022-12-29 12:22:56 +01:00
parent 73c5f6e1bf
commit 860b8fc27f
2 changed files with 2 additions and 2 deletions

View file

@ -270,7 +270,7 @@ static void update_rate(struct impl *impl, bool playback)
impl->current_latency, impl->target_latency);
SPA_FLAG_SET(impl->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
impl->rate_match->rate = corr;
impl->rate_match->rate = 1.0f / corr;
}
static void playback_stream_process(void *d)

View file

@ -272,7 +272,7 @@ static void stream_process(void *data)
if (sess->rate_match) {
SPA_FLAG_SET(sess->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
sess->rate_match->rate = corr;
sess->rate_match->rate = 1.0f / corr;
}
}
spa_ringbuffer_read_data(&sess->ring,