diff options
author | Sangchul Lee <sangchul1011@gmail.com> | 2018-05-25 01:29:53 +0900 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2018-05-31 15:43:36 +0300 |
commit | 8bd91939aca270268319833b9b6cb0701e41f69b (patch) | |
tree | 0c4c6b23142e67989e0bc81692676fc833abef0f /src/pulsecore/source.c | |
parent | 354a690694cf28c859bfdafd252b9120b673b744 (diff) | |
download | pulseaudio-8bd91939aca270268319833b9b6cb0701e41f69b.tar.gz |
udev-detect, alsa-card: Adopt avoid resampling option from daemon.conf
Previously, the "avoid-resampling" option of daemon.conf is to make the
daemon try to use the stream sample rate if possible for all sinks or
sources.
This patch applies this option to module-udev-detect and module-alsa-card
as a module argument in order to override the default value of daemon.conf.
As a result, user can use this argument for more fine-grained control.
e.g.) set it false in daemon.conf and set it true for module-udev-detect
or a particular module-alsa-card in default.pa.(or vice versa)
To set it, use "avoid_resampling=true or false" as the module argument.
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Diffstat (limited to 'src/pulsecore/source.c')
-rw-r--r-- | src/pulsecore/source.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 02ae87a89..dac085ce4 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -258,6 +258,8 @@ pa_source* pa_source_new( else s->alternate_sample_rate = s->core->alternate_sample_rate; + s->avoid_resampling = data->avoid_resampling; + s->outputs = pa_idxset_new(NULL, NULL); s->n_corked = 0; s->monitor_of = NULL; @@ -1025,7 +1027,7 @@ int pa_source_reconfigure(pa_source *s, pa_sample_spec *spec, bool passthrough) uint32_t alternate_rate = s->alternate_sample_rate; bool default_rate_is_usable = false; bool alternate_rate_is_usable = false; - bool avoid_resampling = s->core->avoid_resampling; + bool avoid_resampling = s->avoid_resampling; /* We currently only try to reconfigure the sample rate */ @@ -1093,7 +1095,7 @@ int pa_source_reconfigure(pa_source *s, pa_sample_spec *spec, bool passthrough) if (!passthrough && pa_source_used_by(s) > 0) return -1; - pa_log_debug("Suspending source %s due to changing the sample rate.", s->name); + pa_log_debug("Suspending source %s due to changing the sample rate to %u", s->name, desired_spec.rate); pa_source_suspend(s, true, PA_SUSPEND_INTERNAL); if (s->reconfigure) |