context: use smallest fraction for largest rate

To find the largest rate, we need to select the smallest fraction.

This fixes the case where 44100Hz was selected when there are 2 nodes,
one suggesting 44.1Khz and another 48Khz. After this, 48KHz is
selected.
This commit is contained in:
Wim Taymans 2023-10-02 10:56:06 +02:00
parent bfcbeccec2
commit e1b6a4237f

View file

@ -1365,10 +1365,10 @@ again:
fraction_compare(&s->max_latency, &max_latency) < 0))
max_latency = s->max_latency;
/* largest rate */
/* largest rate, which is in fact the smallest fraction */
if (rate.denom == 0 ||
(s->rate.denom > 0 &&
fraction_compare(&s->rate, &rate) > 0))
fraction_compare(&s->rate, &rate) < 0))
rate = s->rate;
if (s->active)