diff options
-rw-r--r-- | deadbeef.h | 12 | ||||
-rw-r--r-- | plugins/dsp_libsrc/src.c | 142 | ||||
-rw-r--r-- | plugins/dsp_libsrc/src.h | 10 | ||||
-rw-r--r-- | plugins/gtkui/converter.c | 13 | ||||
-rw-r--r-- | plugins/supereq/supereq.c | 173 | ||||
-rw-r--r-- | streamer.c | 35 |
6 files changed, 203 insertions, 182 deletions
@@ -749,16 +749,11 @@ typedef struct DB_output_s { // dsp plugin #define DDB_INIT_DSP_INSTANCE(var,type,plug) {\ memset(var,0,sizeof(type));\ - strncpy (var->inst.id, id, 9);\ - var->inst.id[9]=0;\ var->inst.plugin=plug;\ var->inst.enabled=1;\ } typedef struct DB_dsp_instance_s { - // this id is used to write settings, identify specific instances, etc - char id[10]; - // pointer to DSP plugin which created this instance struct DB_dsp_s *plugin; @@ -767,20 +762,19 @@ typedef struct DB_dsp_instance_s { // read only flag; set by DB_dsp_t::enable unsigned enabled : 1; - } DB_dsp_instance_t; typedef struct DB_dsp_s { DB_plugin_t plugin; - // id is a unique name used to get configuration settings - DB_dsp_instance_t* (*open) (const char *id); + DB_dsp_instance_t* (*open) (void); void (*close) (DB_dsp_instance_t *inst); // samples are interleaved // returned value is number of output frames - int (*process) (DB_dsp_instance_t *inst, float *samples, int frames, int samplerate, int channels); + // can change samplerate and number of channels + int (*process) (DB_dsp_instance_t *inst, float *samples, int frames, int *samplerate, int *channels); void (*reset) (DB_dsp_instance_t *inst); diff --git a/plugins/dsp_libsrc/src.c b/plugins/dsp_libsrc/src.c index 81ea9120..de73ca57 100644 --- a/plugins/dsp_libsrc/src.c +++ b/plugins/dsp_libsrc/src.c @@ -28,34 +28,34 @@ //#define trace(...) { fprintf(stderr, __VA_ARGS__); } #define trace(fmt,...) -DB_functions_t *deadbeef; +static DB_functions_t *deadbeef; #define SRC_BUFFER 16000 #define SRC_MAX_CHANNELS 8 -ddb_dsp_src_t plugin; +static DB_dsp_t plugin; typedef struct { DB_dsp_instance_t inst; int channels; int quality; + float samplerate; SRC_STATE *src; SRC_DATA srcdata; int remaining; // number of input samples in SRC buffer __attribute__((__aligned__(16))) char in_fbuffer[sizeof(float)*SRC_BUFFER*SRC_MAX_CHANNELS]; uintptr_t mutex; + unsigned quality_changed : 1; } ddb_src_libsamplerate_t; DB_dsp_instance_t* -ddb_src_open (const char *id) { +ddb_src_open (void) { ddb_src_libsamplerate_t *src = malloc (sizeof (ddb_src_libsamplerate_t)); - DDB_INIT_DSP_INSTANCE (src,ddb_src_libsamplerate_t,&plugin.dsp); + DDB_INIT_DSP_INSTANCE (src,ddb_src_libsamplerate_t,&plugin); src->mutex = deadbeef->mutex_create (); - char var[20]; - snprintf (var, sizeof (var), "%s.quality", src->inst.id); - src->quality = deadbeef->conf_get_int (var, 2); + src->samplerate = -1; src->channels = -1; return (DB_dsp_instance_t *)src; } @@ -87,58 +87,58 @@ ddb_src_unlock (DB_dsp_instance_t *_src) { } void -ddb_src_reset (DB_dsp_instance_t *_src, int full) { +ddb_src_reset (DB_dsp_instance_t *_src) { ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src; ddb_src_lock (_src); src->remaining = 0; - if (full) { - char var[20]; - snprintf (var, sizeof (var), "%s.quality", _src->id); - int q = deadbeef->conf_get_int (var, 2); - if (q != src->quality && q >= SRC_SINC_BEST_QUALITY && q <= SRC_LINEAR) { - trace ("changing src->quality from %d to %d\n", src->quality, q); - src->quality = q; - memset (&src->srcdata, 0, sizeof (src->srcdata)); - src->channels = -1; - } - else { - src_reset (src->src); - } - } + src_reset (src->src); ddb_src_unlock (_src); } void ddb_src_set_ratio (DB_dsp_instance_t *_src, float ratio) { ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src; - src->srcdata.src_ratio = ratio; - src_set_ratio (src->src, ratio); + if (src->srcdata.src_ratio != ratio) { + src->srcdata.src_ratio = ratio; + src_set_ratio (src->src, ratio); + } } int -ddb_src_process (DB_dsp_instance_t *_src, float *samples, int nframes, int samplerate, int nchannels) { +ddb_src_process (DB_dsp_instance_t *_src, float *samples, int nframes, int *samplerate, int *nchannels) { ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src; + + if (*samplerate == src->samplerate) { + return nframes; + } + ddb_src_lock (_src); - if (src->channels != nchannels) { + float ratio = src->samplerate / *samplerate; + ddb_src_set_ratio (_src, ratio); + *samplerate = src->samplerate; + + if (src->channels != *nchannels || src->quality_changed) { + src->quality_changed = 0; src->remaining = 0; if (src->src) { src_delete (src->src); src->src = NULL; } - src->channels = nchannels; + src->channels = *nchannels; src->src = src_new (src->quality, src->channels, NULL); } + int numoutframes = nframes * src->srcdata.src_ratio; - float outbuf[numoutframes*nchannels]; + float outbuf[numoutframes*(*nchannels)]; int buffersize = sizeof (outbuf); char *output = (char *)outbuf; float *input = samples; int inputsize = numoutframes; - int samplesize = nchannels * sizeof (float); + int samplesize = *nchannels * sizeof (float); do { // add more frames to input SRC buffer @@ -151,7 +151,7 @@ ddb_src_process (DB_dsp_instance_t *_src, float *samples, int nframes, int sampl memcpy (&src->in_fbuffer[src->remaining*samplesize], samples, n * samplesize); src->remaining += n; - samples += n * nchannels; + samples += n * (*nchannels); nframes -= n; } if (!src->remaining) { @@ -195,33 +195,79 @@ ddb_src_process (DB_dsp_instance_t *_src, float *samples, int nframes, int sampl //if (!out) { // out = fopen ("out.raw", "w+b"); //} - //fwrite (input, 1, numoutframes*sizeof(float)*nchannels, out); + //fwrite (input, 1, numoutframes*sizeof(float)*(*nchannels), out); ddb_src_unlock (_src); return numoutframes; } -ddb_dsp_src_t plugin = { - .dsp.plugin.api_vmajor = DB_API_VERSION_MAJOR, - .dsp.plugin.api_vminor = DB_API_VERSION_MINOR, - .dsp.open = ddb_src_open, - .dsp.close = ddb_src_close, - .dsp.process = ddb_src_process, - .dsp.plugin.version_major = 0, - .dsp.plugin.version_minor = 1, - .dsp.plugin.type = DB_PLUGIN_DSP, - .dsp.plugin.id = "SRC", - .dsp.plugin.name = "Secret Rabbit Code", - .dsp.plugin.descr = "Samplerate converter using libsamplerate", - .dsp.plugin.author = "Alexey Yakovenko", - .dsp.plugin.email = "waker@users.sf.net", - .dsp.plugin.website = "http://deadbeef.sf.net", +int +ddb_src_num_params (void) { + return SRC_PARAM_COUNT; +} + +const char * +ddb_src_get_param_name (int p) { + switch (p) { + case SRC_PARAM_QUALITY: + return "Quality"; + case SRC_PARAM_SAMPLERATE: + return "Samplerate"; + default: + fprintf (stderr, "ddb_src_get_param_name: invalid param index (%d)\n", p); + } +} +void +ddb_src_set_param (DB_dsp_instance_t *inst, int p, float val) { + switch (p) { + case SRC_PARAM_SAMPLERATE: + ((ddb_src_libsamplerate_t*)inst)->samplerate = val; + break; + case SRC_PARAM_QUALITY: + ((ddb_src_libsamplerate_t*)inst)->quality = val; + ((ddb_src_libsamplerate_t*)inst)->quality_changed = 1; + break; + default: + fprintf (stderr, "ddb_src_set_param: invalid param index (%d)\n", p); + } +} + +float +ddb_src_get_param (DB_dsp_instance_t *inst, int p) { + switch (p) { + case SRC_PARAM_SAMPLERATE: + return ((ddb_src_libsamplerate_t*)inst)->samplerate; + case SRC_PARAM_QUALITY: + return ((ddb_src_libsamplerate_t*)inst)->quality; + default: + fprintf (stderr, "ddb_src_get_param: invalid param index (%d)\n", p); + } +} + +static DB_dsp_t plugin = { + .plugin.api_vmajor = DB_API_VERSION_MAJOR, + .plugin.api_vminor = DB_API_VERSION_MINOR, + .open = ddb_src_open, + .close = ddb_src_close, + .process = ddb_src_process, + .plugin.version_major = 0, + .plugin.version_minor = 1, + .plugin.type = DB_PLUGIN_DSP, + .plugin.id = "SRC", + .plugin.name = "Secret Rabbit Code", + .plugin.descr = "Samplerate converter using libsamplerate", + .plugin.author = "Alexey Yakovenko", + .plugin.email = "waker@users.sf.net", + .plugin.website = "http://deadbeef.sf.net", + .num_params = ddb_src_num_params, + .get_param_name = ddb_src_get_param_name, + .set_param = ddb_src_set_param, + .get_param = ddb_src_get_param, .reset = ddb_src_reset, - .set_ratio = ddb_src_set_ratio, }; DB_plugin_t * dsp_libsrc_load (DB_functions_t *f) { deadbeef = f; - return &plugin.dsp.plugin; + return &plugin.plugin; } diff --git a/plugins/dsp_libsrc/src.h b/plugins/dsp_libsrc/src.h index 8ede3e1c..33b8b94b 100644 --- a/plugins/dsp_libsrc/src.h +++ b/plugins/dsp_libsrc/src.h @@ -19,10 +19,10 @@ #ifndef __SRC_H #define __SRC_H -typedef struct { - DB_dsp_t dsp; - void (*reset) (DB_dsp_instance_t *inst, int full); - void (*set_ratio) (DB_dsp_instance_t *inst, float ratio); -} ddb_dsp_src_t; +enum { + SRC_PARAM_SAMPLERATE = 0, + SRC_PARAM_QUALITY = 1, + SRC_PARAM_COUNT +}; #endif diff --git a/plugins/gtkui/converter.c b/plugins/gtkui/converter.c index b26247ec..37899db7 100644 --- a/plugins/gtkui/converter.c +++ b/plugins/gtkui/converter.c @@ -202,7 +202,6 @@ ddb_dsp_preset_save (ddb_dsp_preset_t *p, int overwrite) { DB_dsp_instance_t *inst = p->chain; while (inst) { fprintf (fp, "%s {\n", inst->plugin->plugin.id); - fprintf (fp, "\t%s\n", inst->id); if (inst->plugin->num_params) { int n = inst->plugin->num_params (); int i; @@ -802,7 +801,7 @@ fill_dsp_preset_chain (GtkListStore *mdl) { while (dsp) { GtkTreeIter iter; gtk_list_store_append (mdl, &iter); - gtk_list_store_set (mdl, &iter, 0, dsp->plugin->plugin.name, 1, dsp->id, -1); + gtk_list_store_set (mdl, &iter, 0, dsp->plugin->plugin.name, -1); dsp = dsp->next; } } @@ -835,7 +834,7 @@ on_dsp_preset_add_plugin_clicked (GtkButton *button, DB_dsp_instance_t *inst = NULL; for (i = 0; dsp[i]; i++) { if (i == idx) { - inst = dsp[i]->open (title); + inst = dsp[i]->open (); break; } } @@ -890,11 +889,9 @@ on_dsp_preset_add (GtkButton *button, // left list GtkWidget *list = lookup_widget (dlg, "plugins"); GtkCellRenderer *title_cell = gtk_cell_renderer_text_new (); - GtkTreeViewColumn *col1 = gtk_tree_view_column_new_with_attributes (_("ID"), title_cell, "text", 0, NULL); - GtkTreeViewColumn *col2 = gtk_tree_view_column_new_with_attributes (_("Plugin"), title_cell, "text", 1, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (list), GTK_TREE_VIEW_COLUMN (col1)); - gtk_tree_view_append_column (GTK_TREE_VIEW (list), GTK_TREE_VIEW_COLUMN (col2)); - GtkListStore *mdl = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); + GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes (_("Plugin"), title_cell, "text", 0, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (list), GTK_TREE_VIEW_COLUMN (col)); + GtkListStore *mdl = gtk_list_store_new (G_TYPE_STRING); gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (mdl)); } diff --git a/plugins/supereq/supereq.c b/plugins/supereq/supereq.c index 498b01e1..9ce7b9f8 100644 --- a/plugins/supereq/supereq.c +++ b/plugins/supereq/supereq.c @@ -40,51 +40,8 @@ typedef struct { SuperEqState state; } ddb_supereq_instance_t; -static float -dsp_conf_get_float (DB_dsp_instance_t *inst, const char *name, float def) { - char key[100]; - snprintf (key, sizeof (key), "%s.%s", inst->id, name); - return deadbeef->conf_get_float (key, def); -} - -static int -dsp_conf_get_int (DB_dsp_instance_t *inst, const char *name, int def) { - char key[100]; - snprintf (key, sizeof (key), "%s.%s", inst->id, name); - return deadbeef->conf_get_int (key, def); -} - -static void -dsp_conf_set_float (DB_dsp_instance_t *inst, const char *name, float value) { - char key[100]; - snprintf (key, sizeof (key), "%s.%s", inst->id, name); - return deadbeef->conf_set_float (key, value); -} - -static void -dsp_conf_set_int (DB_dsp_instance_t *inst, const char *name, int value) { - char key[100]; - snprintf (key, sizeof (key), "%s.%s", inst->id, name); - return deadbeef->conf_set_int (key, value); -} - void supereq_reset (DB_dsp_instance_t *inst); -#if 0 -static int -supereq_on_configchanged (DB_event_t *ev, uintptr_t data) { - int e = deadbeef->conf_get_int ("supereq.enable", 0); - if (e != enabled) { - if (e) { - supereq_reset (); - } - enabled = e; - } - - return 0; -} -#endif - void recalc_table (ddb_supereq_instance_t *eq) { void *params = paramlist_alloc (); @@ -111,43 +68,11 @@ recalc_table (ddb_supereq_instance_t *eq) { int supereq_plugin_start (void) { -#if 0 - enabled = deadbeef->conf_get_int ("supereq.enable", 0); - // load bands from config - preamp = deadbeef->conf_get_float ("eq.preamp", 1); - for (int i = 0; i < 18; i++) { - char key[100]; - snprintf (key, sizeof (key), "eq.band%d", i); - lbands[i] = rbands[i] = deadbeef->conf_get_float (key, 1); - } - - equ_init (14); - paramsroot = paramlist_alloc (); - last_srate = 44100; - last_nch = 2; - mutex = deadbeef->mutex_create (); - recalc_table (); - equ_clearbuf (); -// deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (supereq_on_configchanged), 0); -#endif return 0; } int supereq_plugin_stop (void) { -#if 0 - deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (supereq_on_configchanged), 0); - if (tid) { - deadbeef->thread_join (tid); - tid = 0; - } - if (mutex) { - deadbeef->mutex_free (mutex); - mutex = 0; - } - equ_quit (); - paramlist_free (paramsroot); -#endif return 0; } @@ -159,28 +84,28 @@ supereq_regen_table_thread (void *param) { } int -supereq_process (DB_dsp_instance_t *inst, float *samples, int frames, int samplerate, int channels) { +supereq_process (DB_dsp_instance_t *inst, float *samples, int frames, int *samplerate, int *channels) { ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst; if (supereq->params_changed && !supereq->tid) { supereq->tid = deadbeef->thread_start (supereq_regen_table_thread, inst); supereq->params_changed = 0; } - if (supereq->last_srate != samplerate) { + if (supereq->last_srate != *samplerate) { deadbeef->mutex_lock (supereq->mutex); //equ_makeTable (lbands, rbands, paramsroot, srate); - supereq->last_srate = samplerate; - supereq->last_nch = channels; + supereq->last_srate = *samplerate; + supereq->last_nch = *channels; recalc_table ((ddb_supereq_instance_t *)inst); deadbeef->mutex_unlock (supereq->mutex); equ_clearbuf(&supereq->state); } - else if (supereq->last_nch != channels) { + else if (supereq->last_nch != *channels) { deadbeef->mutex_lock (supereq->mutex); - supereq->last_nch = channels; + supereq->last_nch = *channels; deadbeef->mutex_unlock (supereq->mutex); equ_clearbuf(&supereq->state); } - equ_modifySamples_float(&supereq->state, (char *)samples,frames,channels); + equ_modifySamples_float(&supereq->state, (char *)samples,frames,*channels); return frames; } @@ -197,9 +122,6 @@ supereq_set_band (DB_dsp_instance_t *inst, int band, float value) { supereq->lbands[band] = supereq->rbands[band] = value; deadbeef->mutex_unlock (supereq->mutex); supereq->params_changed = 1; - char key[100]; - snprintf (key, sizeof (key), "band%d", band); - dsp_conf_set_float (inst, key, value); } float @@ -215,7 +137,6 @@ supereq_set_preamp (DB_dsp_instance_t *inst, float value) { supereq->preamp = value; deadbeef->mutex_unlock (supereq->mutex); supereq->params_changed = 1; - dsp_conf_set_float (inst, "preamp", value); } void @@ -230,7 +151,6 @@ void supereq_enable (DB_dsp_instance_t *inst, int e) { ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst; if (e != supereq->inst.enabled) { - dsp_conf_set_int (inst, "enabled", e); if (e && !supereq->inst.enabled) { supereq_reset (inst); } @@ -238,19 +158,70 @@ supereq_enable (DB_dsp_instance_t *inst, int e) { } } -DB_dsp_instance_t* -supereq_open (const char *id) { - ddb_supereq_instance_t *supereq = malloc (sizeof (ddb_supereq_instance_t)); - DDB_INIT_DSP_INSTANCE (supereq,ddb_supereq_instance_t,&plugin.dsp); +int +supereq_num_params (void) { + return 19; +} - supereq->preamp = dsp_conf_get_float (&supereq->inst, "preamp", 1); - for (int i = 0; i < 18; i++) { - char key[100]; - snprintf (key, sizeof (key), "band%d", i); - supereq->lbands[i] = supereq->rbands[i] = dsp_conf_get_float (&supereq->inst, key, 1); +static const char *bandnames[] = { + "Preamp", + "55 Hz", + "77 Hz", + "110 Hz", + "156 Hz", + "220 Hz", + "311 Hz", + "440 Hz", + "622 Hz", + "880 Hz", + "1.2 kHz", + "1.8 kHz", + "2.5 kHz", + "3.5 kHz", + "5 kHz", + "7 kHz", + "10 kHz", + "14 kHz", + "20 kHz" +}; + +const char * +supereq_get_param_name (int p) { + return bandnames[p]; +} +void +supereq_set_param (DB_dsp_instance_t *inst, int p, float val) { + switch (p) { + case 0: + supereq_set_preamp (inst, val); + break; + case 1 ... 18: + supereq_set_band (inst, p, val); + break; + default: + fprintf (stderr, "supereq_set_param: invalid param index (%d)\n", p); } +} + +float +supereq_get_param (DB_dsp_instance_t *inst, int p) { + switch (p) { + case 0: + return supereq_get_preamp (inst); + break; + case 1 ... 18: + return supereq_get_band (inst, p); + break; + default: + fprintf (stderr, "supereq_get_param: invalid param index (%d)\n", p); + } +} - supereq->inst.enabled = dsp_conf_get_int (&supereq->inst, "enabled", 0); + +DB_dsp_instance_t* +supereq_open (void) { + ddb_supereq_instance_t *supereq = malloc (sizeof (ddb_supereq_instance_t)); + DDB_INIT_DSP_INSTANCE (supereq,ddb_supereq_instance_t,&plugin.dsp); equ_init (&supereq->state, 14); supereq->paramsroot = paramlist_alloc (); @@ -300,10 +271,10 @@ static DB_supereq_dsp_t plugin = { .dsp.process = supereq_process, .dsp.reset = supereq_reset, .dsp.enable = supereq_enable, - .get_band = supereq_get_band, - .set_band = supereq_set_band, - .get_preamp = supereq_get_preamp, - .set_preamp = supereq_set_preamp, + .dsp.num_params = supereq_num_params, + .dsp.get_param_name = supereq_get_param_name, + .dsp.set_param = supereq_set_param, + .dsp.get_param = supereq_get_param, }; DB_plugin_t * @@ -48,7 +48,7 @@ FILE *out; #endif static intptr_t streamer_tid; -static ddb_dsp_src_t *srcplug; +static DB_dsp_t *srcplug; static DB_dsp_t *eqplug; static DB_dsp_instance_t *dsp_chain; static DB_dsp_instance_t *src; @@ -740,7 +740,7 @@ streamer_start_new_song (void) { int pstate = nextsong_pstate; nextsong = -1; if (srcplug) { - srcplug->reset (src, 0); + srcplug->reset (src); } streamer_unlock (); if (badsong == sng) { @@ -1132,9 +1132,10 @@ streamer_init (void) { decodemutex = mutex_create (); // find src plugin, and use it if found - srcplug = (ddb_dsp_src_t*)plug_get_for_id ("SRC"); + srcplug = (DB_dsp_t*)plug_get_for_id ("SRC"); if (srcplug) { - src = srcplug->dsp.open ("strm_src"); + src = srcplug->open (); + srcplug->set_param (src, SRC_PARAM_QUALITY, conf_get_int ("src_quality", 2)); src->next = dsp_chain; dsp_chain = src; } @@ -1142,7 +1143,17 @@ streamer_init (void) { // eq plug eqplug = (DB_dsp_t *)plug_get_for_id ("supereq"); if (eqplug) { - eq = eqplug->open ("strm_eq"); + eq = eqplug->open (); + + // load settings + eqplug->enable (eq, deadbeef->conf_get_int ("supereq.enable", 0)); + eqplug->set_param (eq, 0, conf_get_float ("eq.preamp", 1)); + for (int i = 0; i < 18; i++) { + char key[100]; + snprintf (key, sizeof (key), "eq.band%d", i); + eqplug->set_param (eq, 1+i, conf_get_float (key, 1)); + } + eq->next = dsp_chain; dsp_chain = eq; } @@ -1179,7 +1190,7 @@ streamer_free (void) { mutex_free (mutex); mutex = 0; if (srcplug && src) { - srcplug->dsp.close (src); + srcplug->close (src); srcplug = NULL; src = NULL; } @@ -1330,8 +1341,6 @@ streamer_read_async (char *bytes, int size) { // convert to float, pass through streamer DSP chain int dspsamplesize = output->fmt.channels * sizeof (float); - float ratio = output->fmt.samplerate/(float)fileinfo->fmt.samplerate; - int max_out_frames = size / (output->fmt.channels * output->fmt.bps / 8); int dsp_num_frames = max_out_frames; @@ -1359,17 +1368,21 @@ streamer_read_async (char *bytes, int size) { // convert to float int tempsize = pcm_convert (&fileinfo->fmt, input, &dspfmt, tempbuf, inputsize); if (srcplug) { - srcplug->set_ratio (src, ratio); + srcplug->set_param (src, SRC_PARAM_SAMPLERATE, dspfmt.samplerate); } int nframes = inputsize / inputsamplesize; DB_dsp_instance_t *dsp = dsp_chain; + int samplerate = fileinfo->fmt.samplerate; + int channels = dspfmt.channels; while (dsp) { if (dsp->enabled) { - nframes = dsp->plugin->process (dsp, (float *)tempbuf, nframes, dspfmt.samplerate, dspfmt.channels); + nframes = dsp->plugin->process (dsp, (float *)tempbuf, nframes, &samplerate, &channels); } dsp = dsp->next; } + dspfmt.samplerate = samplerate; + dspfmt.channels = channels; int n = pcm_convert (&dspfmt, tempbuf, &output->fmt, bytes, nframes * dspsamplesize); bytesread = n; @@ -1516,7 +1529,7 @@ streamer_configchanged (void) { conf_replaygain_scale = conf_get_int ("replaygain_scale", 1); if (srcplug) { - srcplug->reset (src, 1); + srcplug->set_param (src, SRC_PARAM_QUALITY, conf_get_int ("src_quality", 2)); } } |