[pulseaudio-discuss] [PATCH] alsa-sink/source: Allow to set reconfigure callback for avoiding resampling option

Sangchul Lee sangchul1011 at gmail.com
Thu Apr 26 13:28:09 UTC 2018


From: Sangchul Lee <sangchul1011 at gmail.com>

Reconfiguration callback should be set in case of avoiding resampling
option. This patch adds an explicit condition for that.

Signed-off-by: Sangchul Lee <sc11.lee at samsung.com>
---
 src/modules/alsa/alsa-sink.c   | 2 +-
 src/modules/alsa/alsa-source.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index afdf813..950d1ed 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2434,7 +2434,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
         u->sink->set_port = sink_set_port_ucm_cb;
     else
         u->sink->set_port = sink_set_port_cb;
-    if (u->sink->alternate_sample_rate)
+    if (u->core->avoid_resampling || u->sink->alternate_sample_rate)
         u->sink->reconfigure = sink_reconfigure_cb;
     u->sink->userdata = u;
 
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 73c2a25..e2943bb 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -2110,7 +2110,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
         u->source->set_port = source_set_port_ucm_cb;
     else
         u->source->set_port = source_set_port_cb;
-    if (u->source->alternate_sample_rate)
+    if (u->core->avoid_resampling || u->source->alternate_sample_rate)
         u->source->reconfigure = source_reconfigure_cb;
     u->source->userdata = u;
 
-- 
2.7.4



More information about the pulseaudio-discuss mailing list