sink, source: Use the global configuration for the avoid_resampling default

Previously avoid_resampling was always false unless the sink or source
implementation explicitly configured the variable. The null sink doesn't
explicitly configure it, so it didn't switch the sample rate as
expected when avoid_resampling was enabled.

This change means that also sinks that don't support rate switching can
have avoid_resampling set to true, but I think that's fine, because
pa_sink_reconfigure() doesn't try to do anything if the reconfigure()
callback isn't set.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/923
This commit is contained in:
Tanu Kaskinen 2020-06-21 18:23:14 +03:00 committed by Arun Raghavan
parent d97075c79f
commit 04c554b7d5
6 changed files with 29 additions and 5 deletions

View file

@ -2221,7 +2221,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_source_new_data_done(&data);
goto fail;
}
data.avoid_resampling = avoid_resampling;
pa_source_new_data_set_avoid_resampling(&data, avoid_resampling);
pa_source_new_data_set_sample_spec(&data, &ss);
pa_source_new_data_set_channel_map(&data, &map);