[4/6] combine-sink: Use configured resampler, reduce update time to 1s

Submitted by Georg Chini on April 9, 2018, 4:33 p.m.

Details

Message ID 20180409163321.17279-5-georg@chini.tk
State New
Series "combine-sink, tunnel-sink: Latency fixes"
Headers show

Commit Message

Georg Chini April 9, 2018, 4:33 p.m.
Currently the combine-sink uses the trivial resampler by default.

This patch changes the default to the configured resampler.
Also the default update time is changed from 10s to 1s to achieve
faster convergence and higher precision.
---
 src/modules/module-combine-sink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index 559f6575..79b4c6d9 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -64,7 +64,7 @@  PA_MODULE_USAGE(
 
 #define MEMBLOCKQ_MAXLENGTH (1024*1024*16)
 
-#define DEFAULT_ADJUST_TIME_USEC (10*PA_USEC_PER_SEC)
+#define DEFAULT_ADJUST_TIME_USEC (1*PA_USEC_PER_SEC)
 
 #define BLOCK_USEC (PA_USEC_PER_MSEC * 200)
 
@@ -1421,7 +1421,7 @@  int pa__init(pa_module*m) {
     struct userdata *u;
     pa_modargs *ma = NULL;
     const char *slaves, *rm;
-    int resample_method = PA_RESAMPLER_TRIVIAL;
+    int resample_method;
     pa_sample_spec ss;
     pa_channel_map map;
     struct output *o;
@@ -1437,6 +1437,7 @@  int pa__init(pa_module*m) {
         goto fail;
     }
 
+    resample_method = m->core->resample_method;
     if ((rm = pa_modargs_get_value(ma, "resample_method", NULL))) {
         if ((resample_method = pa_parse_resample_method(rm)) < 0) {
             pa_log("invalid resample method '%s'", rm);