summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/memblockq.c12
-rw-r--r--src/protocol-esound.c2
-rw-r--r--src/todo3
3 files changed, 14 insertions, 3 deletions
diff --git a/src/memblockq.c b/src/memblockq.c
index fb4cbc7e..6d4d712a 100644
--- a/src/memblockq.c
+++ b/src/memblockq.c
@@ -82,6 +82,18 @@ void pa_memblockq_push(struct pa_memblockq* bq, const struct pa_memchunk *chunk,
struct memblock_list *q;
assert(bq && chunk && chunk->memblock && chunk->length && (chunk->length % bq->base) == 0);
+ if (bq->blocks_tail && bq->blocks_tail->chunk.memblock == chunk->memblock) {
+ /* Try to merge memory chunks */
+
+ if (bq->blocks_tail->chunk.index+bq->blocks_tail->chunk.length == chunk->index) {
+ bq->blocks_tail->chunk.length += chunk->length;
+ bq->current_length += chunk->length;
+
+ /* fprintf(stderr, __FILE__": merge succeeded: %u\n", chunk->length);*/
+ return;
+ }
+ }
+
q = malloc(sizeof(struct memblock_list));
assert(q);
diff --git a/src/protocol-esound.c b/src/protocol-esound.c
index e97ab34d..4d9ca546 100644
--- a/src/protocol-esound.c
+++ b/src/protocol-esound.c
@@ -394,7 +394,7 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
continue;
assert(t >= s+k+k);
-
+
if (conn->sink_input) {
rate = conn->sink_input->sample_spec.rate;
volume = (conn->sink_input->volume*0xFF)/0x100;
diff --git a/src/todo b/src/todo
index 1e1e02c5..8c647a8d 100644
--- a/src/todo
+++ b/src/todo
@@ -9,8 +9,6 @@
- move more stuff from module-oss[-dma] to liboss-util
-- merge memchunks in memblockq
-
- create libstatustext, libsocketutil
- prefix modules/libraries with pa_
@@ -29,6 +27,7 @@
- autoloading/autounloading
- slp/rendezvous
- doxygen
+- make mcalign merge chunks
drivers:
- libao