summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-01-15 14:24:25 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-01-15 14:24:25 +0200
commit7fd14b6f580fd427ebe4a869383ee76ecfe4ef5f (patch)
tree577e5c89600eead2c727f1997b2150ed8f7501a8
parente96785c1c34706e902f28c25844f31d8201db2b2 (diff)
Revert "ladspa-sink: Handle empty chunks in sink_input_pop_cb"
This reverts commit dbe66b0b5e6b6e24df45bda8bf656836f18e7f4b. I accidentally pushed this patch that was superseded by e96785c1c34706e902f28c25844f31d8201db2b2.
-rw-r--r--src/modules/module-ladspa-sink.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 46ce9e44..cbb1aea6 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -474,29 +474,22 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
pa_memblockq_drop(u->memblockq, chunk->length);
- src = (tchunk.memblock ? pa_memblock_acquire_chunk(&tchunk) : NULL);
+ src = pa_memblock_acquire_chunk(&tchunk);
dst = pa_memblock_acquire(chunk->memblock);
for (h = 0; h < (u->channels / u->max_ladspaport_count); h++) {
- if (src) {
- for (c = 0; c < u->input_count; c++)
- pa_sample_clamp(PA_SAMPLE_FLOAT32NE, u->input[c], sizeof(float), src+ h*u->max_ladspaport_count + c, u->channels*sizeof(float), n);
- } else {
- for (c = 0; c < u->input_count; c++)
- memset(u->input[c], 0, (n * sizeof(float)));
- }
+ for (c = 0; c < u->input_count; c++)
+ pa_sample_clamp(PA_SAMPLE_FLOAT32NE, u->input[c], sizeof(float), src+ h*u->max_ladspaport_count + c, u->channels*sizeof(float), n);
u->descriptor->run(u->handle[h], n);
for (c = 0; c < u->output_count; c++)
pa_sample_clamp(PA_SAMPLE_FLOAT32NE, dst + h*u->max_ladspaport_count + c, u->channels*sizeof(float), u->output[c], sizeof(float), n);
}
- if (tchunk.memblock) {
- pa_memblock_release(tchunk.memblock);
- pa_memblock_unref(tchunk.memblock);
- }
-
+ pa_memblock_release(tchunk.memblock);
pa_memblock_release(chunk->memblock);
+ pa_memblock_unref(tchunk.memblock);
+
return 0;
}