summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-22 11:03:55 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-22 11:03:55 +0200
commit4f333fc17885b66a5163e3a1bb82eb44d8e8fe01 (patch)
tree0cae49ccc6b99555cdc3bedd3217884903f47e48 /streamer.c
parenta29387858a5789244df6bf01b06d32393033c21a (diff)
auto-add resampler to streamer dsp chain on 1st run
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/streamer.c b/streamer.c
index adedfac6..ede20df5 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1540,6 +1540,19 @@ streamer_dsp_init (void) {
char fname[PATH_MAX];
snprintf (fname, sizeof (fname), "%s/dspconfig", plug_get_config_dir ());
dsp_chain = streamer_dsp_chain_load (fname);
+ if (!dsp_chain) {
+ // first run, let's add resampler
+ DB_dsp_t *src = (DB_dsp_t *)plug_get_for_id ("SRC");
+ if (src) {
+ ddb_dsp_context_t *inst = src->open ();
+ inst->enabled = 0;
+ src->set_param (inst, 0, "48000"); // samplerate
+ src->set_param (inst, 1, "2"); // quality=SINC_FASTEST
+ src->set_param (inst, 2, "1"); // auto
+ inst->next = dsp_chain;
+ dsp_chain = inst;
+ }
+ }
eqplug = (DB_dsp_t *)plug_get_for_id ("supereq");
streamer_dsp_postinit ();