diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 4f2fde8b6..f919a9eb1 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -2063,8 +2063,6 @@ static void recalc_headroom(struct state *state) state->headroom = 0; latency = SPA_MAX(state->min_delay, SPA_MIN(state->max_delay, state->headroom)); - if (rate != 0 && state->rate != 0) - latency = SPA_SCALE32_UP(latency, rate, state->rate); if (state->is_firewire) { /* XXX: For ALSA FireWire drivers, unlike for other ALSA drivers, buffer size @@ -2072,6 +2070,8 @@ static void recalc_headroom(struct state *state) */ latency += state->buffer_frames; } + if (rate != 0 && state->rate != 0) + latency = SPA_SCALE32_UP(latency, rate, state->rate); state->latency[state->port_direction].min_rate = state->latency[state->port_direction].max_rate = latency;