summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-12-16 21:26:58 +0100
committerGravatar waker <wakeroid@gmail.com>2010-12-16 21:26:58 +0100
commitcd9d7d54306e8a14e46838f9eb796893ff20fa3c (patch)
treec35f7bd8af2e2c3fdd55245b06ae4b592655d486 /streamer.c
parentebe72b659f00ea32e50bd103c940b7de93fbe82c (diff)
fixed dsp chain usage when use alsa resampling is turned on
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/streamer.c b/streamer.c
index ba3eabe1..45ad492c 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1337,7 +1337,17 @@ streamer_read_async (char *bytes, int size) {
if (fileinfo->fmt.samplerate != -1) {
int outputsamplesize = output->fmt.channels * output->fmt.bps / 8;
int inputsamplesize = fileinfo->fmt.channels * fileinfo->fmt.bps / 8;
- if (!memcmp (&fileinfo->fmt, &output->fmt, sizeof (ddb_waveformat_t))) {
+
+ // FIXME: SLOWWW - recalculate that only after chain been changed
+ ddb_dsp_context_t *ctx = dsp_chain;
+ while (ctx) {
+ if (ctx->enabled) {
+ break;
+ }
+ ctx = ctx->next;
+ }
+
+ if (!memcmp (&fileinfo->fmt, &output->fmt, sizeof (ddb_waveformat_t)) && !ctx) {
// pass through from input to output
bytesread = fileinfo->plugin->read (fileinfo, bytes, size);
@@ -1345,7 +1355,7 @@ streamer_read_async (char *bytes, int size) {
is_eof = 1;
}
}
- else if (output->fmt.samplerate != fileinfo->fmt.samplerate) {
+ else if (ctx) {
// convert to float, pass through streamer DSP chain
int dspsamplesize = output->fmt.channels * sizeof (float);