mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-11 04:27:56 -05:00
alsa-pcm: set rate_match rate to 1.0 when not matching
Only set rate_match rate to DLL correction when matching is active. When ALSA is driver and not matching, set rate to 1.0 to indicate no rate adjustment needed. DLL still runs for buffer level management but rate_match should not expose correction when matching is inactive to avoid confusion during debugging. Signed-off-by: Stanislav Ruzani <stanislav.ruzani@streamunlimited.com>
This commit is contained in:
parent
bac776f8b4
commit
64e0a9cbd9
1 changed files with 11 additions and 4 deletions
|
|
@ -3040,10 +3040,17 @@ static int update_time(struct state *state, uint64_t current_time, snd_pcm_sfram
|
|||
}
|
||||
|
||||
if (state->rate_match) {
|
||||
if (state->stream == SND_PCM_STREAM_PLAYBACK)
|
||||
state->rate_match->rate = corr;
|
||||
else
|
||||
state->rate_match->rate = 1.0/corr;
|
||||
/* Only set rate_match rate when matching is active. When not matching,
|
||||
* set it to 1.0 to indicate no rate adjustment needed, even though DLL
|
||||
* may still be running for buffer level management. */
|
||||
if (state->matching) {
|
||||
if (state->stream == SND_PCM_STREAM_PLAYBACK)
|
||||
state->rate_match->rate = corr;
|
||||
else
|
||||
state->rate_match->rate = 1.0/corr;
|
||||
} else {
|
||||
state->rate_match->rate = 1.0;
|
||||
}
|
||||
|
||||
if (state->pitch_elem && state->matching)
|
||||
spa_alsa_update_rate_match(state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue