autoload management
- more complete pactl
- daemon autostart
-- cleanup tagstruct (add s32, pa_volume_t, pa_usec_t)
-- xmlrpc
+- cleanup tagstruct and modargs (add s32, pa_volume_t, pa_usec_t)
- remove all gcc warnings
- esd compatible startup script or personality
+- limit number of concurrent streams
** later ***
+- xmlrpc/http
- slp/rendezvous
- modinfo
- make alsa modules use mmap
- gstreamer
- portaudio
- python
-
-modules:
-- http?
n = pa_memblock_new(c->length, s);
assert(n);
- memcpy(n->data, c->memblock->data+c->index, c->length);
+ memcpy(n->data, (uint8_t*) c->memblock->data+c->index, c->length);
pa_memblock_unref(c->memblock);
c->memblock = n;
c->index = 0;
l = m->chunk.length;
assert(m->buffer && l);
- memcpy(m->buffer + m->buffer_fill, m->chunk.memblock->data + m->chunk.index, l);
+ memcpy((uint8_t*) m->buffer + m->buffer_fill, (uint8_t*) m->chunk.memblock->data + m->chunk.index, l);
m->buffer_fill += l;
m->chunk.index += l;
m->chunk.length -= l;
assert(!m->buffer);
m->buffer = pa_xmalloc(m->base);
m->chunk.length -= m->buffer_fill;
- memcpy(m->buffer, m->chunk.memblock->data + m->chunk.index + m->chunk.length, m->buffer_fill);
+ memcpy(m->buffer, (uint8_t*) m->chunk.memblock->data + m->chunk.index + m->chunk.length, m->buffer_fill);
}
if (m->chunk.length) {
if (u->out_memblocks[u->out_current])
pa_memblock_unref_fixed(u->out_memblocks[u->out_current]);
- chunk.memblock = u->out_memblocks[u->out_current] = pa_memblock_new_fixed(u->out_mmap+u->out_fragment_size*u->out_current, u->out_fragment_size, u->core->memblock_stat);
+ chunk.memblock = u->out_memblocks[u->out_current] = pa_memblock_new_fixed((uint8_t*)u->out_mmap+u->out_fragment_size*u->out_current, u->out_fragment_size, u->core->memblock_stat);
assert(chunk.memblock);
chunk.length = chunk.memblock->length;
chunk.index = 0;
struct pa_memchunk chunk;
if (!u->in_memblocks[u->in_current]) {
- chunk.memblock = u->in_memblocks[u->in_current] = pa_memblock_new_fixed(u->in_mmap+u->in_fragment_size*u->in_current, u->in_fragment_size, u->core->memblock_stat);
+ chunk.memblock = u->in_memblocks[u->in_current] = pa_memblock_new_fixed((uint8_t*) u->in_mmap+u->in_fragment_size*u->in_current, u->in_fragment_size, u->core->memblock_stat);
chunk.length = chunk.memblock->length;
chunk.index = 0;
if (l > buffer_length)
l = buffer_length;
- pa_stream_write(stream, buffer+buffer_index, l, NULL, 0);
+ pa_stream_write(stream, (uint8_t*) buffer + buffer_index, l, NULL, 0);
buffer_length -= l;
buffer_index += l;
assert(buffer_length);
- if ((r = write(fd, buffer+buffer_index, buffer_length)) <= 0) {
+ if ((r = write(fd, (uint8_t*) buffer+buffer_index, buffer_length)) <= 0) {
fprintf(stderr, "write() failed: %s\n", strerror(errno));
quit(1);
break;
ret += r;
- data += r;
+ data = (uint8_t*) data + r;
size -= r;
}
#include "llist.h"
#include "native-common.h"
-#define DEFAULT_TLENGTH (10240*4)
+#define DEFAULT_TLENGTH (10240*8)
#define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)
#define DEFAULT_PREBUF DEFAULT_TLENGTH
#define DEFAULT_MINREQ 512
l = length;
pa_stream_write(p->stream, data, l, NULL, 0);
- data += l;
+ data = (uint8_t*) data + l;
length -= l;
}
if (p->read_length <= l)
l = p->read_length;
- memcpy(data, p->read_data+p->read_index, l);
+ memcpy(data, (uint8_t*) p->read_data+p->read_index, l);
- data += l;
+ data = (uint8_t*) data + l;
length -= l;
p->read_index += l;
i = c->write_data_length;
c->write_data_length += length;
- return c->write_data+i;
+ return (uint8_t*) c->write_data+i;
}
static void format_esd2native(int format, struct pa_sample_spec *ss) {
c->authorized = 1;
}
- ekey = *(uint32_t*)(data+ESD_KEY_LEN);
+ ekey = *(uint32_t*)((uint8_t*) data+ESD_KEY_LEN);
if (ekey == ESD_ENDIAN_KEY)
c->swap_byte_order = 0;
else if (ekey == ESD_SWAP_ENDIAN_KEY)
return -1;
}
- strncpy(name, data + sizeof(int)*2, sizeof(name));
+ strncpy(name, (char*) data + sizeof(int)*2, sizeof(name));
name[sizeof(name)-1] = 0;
pa_client_rename(c->client, name);
return -1;
}
- strncpy(name, data + sizeof(int)*2, sizeof(name));
+ strncpy(name, (char*) data + sizeof(int)*2, sizeof(name));
name[sizeof(name)-1] = 0;
pa_client_rename(c->client, name);
}
static int esd_proto_all_info(struct connection *c, esd_proto_t request, const void *data, size_t length) {
- void *response;
+ uint8_t *response;
size_t t, k, s;
struct connection *conn;
size_t index = PA_IDXSET_INVALID;
/* name */
assert(conn->client);
- strncpy(response, conn->client->name, ESD_NAME_MAX);
+ strncpy((char*) response, conn->client->name, ESD_NAME_MAX);
response += ESD_NAME_MAX;
/* rate */
/* name */
if (strncmp(ce->name, SCACHE_PREFIX, sizeof(SCACHE_PREFIX)-1) == 0)
- strncpy(response, ce->name+sizeof(SCACHE_PREFIX)-1, ESD_NAME_MAX);
+ strncpy((char*) response, ce->name+sizeof(SCACHE_PREFIX)-1, ESD_NAME_MAX);
else
- snprintf(response, ESD_NAME_MAX, "native.%s", ce->name);
+ snprintf((char*) response, ESD_NAME_MAX, "native.%s", ce->name);
response += ESD_NAME_MAX;
/* rate */
return -1;
strcpy(name, SCACHE_PREFIX);
- strncpy(name+sizeof(SCACHE_PREFIX)-1, data+3*sizeof(int), ESD_NAME_MAX);
+ strncpy(name+sizeof(SCACHE_PREFIX)-1, (char*) data+3*sizeof(int), ESD_NAME_MAX);
name[sizeof(name)-1] = 0;
assert(!c->scache_memchunk.memblock);
ssize_t r;
assert(c->read_data_length < sizeof(c->request));
- if ((r = pa_iochannel_read(c->io, ((void*) &c->request) + c->read_data_length, sizeof(c->request) - c->read_data_length)) <= 0) {
+ if ((r = pa_iochannel_read(c->io, ((uint8_t*) &c->request) + c->read_data_length, sizeof(c->request) - c->read_data_length)) <= 0) {
fprintf(stderr, "protocol-esound.c: read() failed: %s\n", r == 0 ? "EOF" : strerror(errno));
return -1;
}
assert(c->read_data && c->read_data_length < handler->data_length);
- if ((r = pa_iochannel_read(c->io, c->read_data + c->read_data_length, handler->data_length - c->read_data_length)) <= 0) {
+ if ((r = pa_iochannel_read(c->io, (uint8_t*) c->read_data + c->read_data_length, handler->data_length - c->read_data_length)) <= 0) {
fprintf(stderr, "protocol-esound.c: read() failed: %s\n", r == 0 ? "EOF" : strerror(errno));
return -1;
}
assert(c->scache_memchunk.memblock && c->scache_name && c->scache_memchunk.index < c->scache_memchunk.length);
- if ((r = pa_iochannel_read(c->io, c->scache_memchunk.memblock->data+c->scache_memchunk.index, c->scache_memchunk.length-c->scache_memchunk.index)) <= 0) {
+ if ((r = pa_iochannel_read(c->io, (uint8_t*) c->scache_memchunk.memblock->data+c->scache_memchunk.index, c->scache_memchunk.length-c->scache_memchunk.index)) <= 0) {
fprintf(stderr, __FILE__": read() failed: %s\n", r == 0 ? "EOF" : strerror(errno));
return -1;
}
c->playback.memblock_index = 0;
}
- if ((r = pa_iochannel_read(c->io, c->playback.current_memblock->data+c->playback.memblock_index, l)) <= 0) {
+ if ((r = pa_iochannel_read(c->io, (uint8_t*) c->playback.current_memblock->data+c->playback.memblock_index, l)) <= 0) {
fprintf(stderr, __FILE__": read() failed: %s\n", r == 0 ? "EOF" : strerror(errno));
return -1;
}
ssize_t r;
assert(c->write_data_index < c->write_data_length);
- if ((r = pa_iochannel_write(c->io, c->write_data+c->write_data_index, c->write_data_length-c->write_data_index)) < 0) {
+ if ((r = pa_iochannel_write(c->io, (uint8_t*) c->write_data+c->write_data_index, c->write_data_length-c->write_data_index)) < 0) {
fprintf(stderr, __FILE__": write() failed: %s\n", strerror(errno));
return -1;
}
assert(chunk.memblock && chunk.length);
- if ((r = pa_iochannel_write(c->io, chunk.memblock->data+chunk.index, chunk.length)) < 0) {
+ if ((r = pa_iochannel_write(c->io, (uint8_t*) chunk.memblock->data+chunk.index, chunk.length)) < 0) {
pa_memblock_unref(chunk.memblock);
fprintf(stderr, __FILE__": write(): %s\n", strerror(errno));
return -1;
c->playback.memblock_index = 0;
}
- if ((r = pa_iochannel_read(c->io, c->playback.current_memblock->data+c->playback.memblock_index, l)) <= 0) {
+ if ((r = pa_iochannel_read(c->io, (uint8_t*) c->playback.current_memblock->data+c->playback.memblock_index, l)) <= 0) {
fprintf(stderr, __FILE__": read() failed: %s\n", r == 0 ? "EOF" : strerror(errno));
return -1;
}
assert(chunk.memblock && chunk.length);
- if ((r = pa_iochannel_write(c->io, chunk.memblock->data+chunk.index, chunk.length)) < 0) {
+ if ((r = pa_iochannel_write(c->io, (uint8_t*) chunk.memblock->data+chunk.index, chunk.length)) < 0) {
pa_memblock_unref(chunk.memblock);
fprintf(stderr, "write(): %s\n", strerror(errno));
return -1;
p->write.descriptor[PA_PSTREAM_DESCRIPTOR_DELTA] = 0;
} else {
assert(p->write.current->type == PA_PSTREAM_ITEM_MEMBLOCK && p->write.current->chunk.memblock);
- p->write.data = p->write.current->chunk.memblock->data + p->write.current->chunk.index;
+ p->write.data = (uint8_t*) p->write.current->chunk.memblock->data + p->write.current->chunk.index;
p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH] = htonl(p->write.current->chunk.length);
p->write.descriptor[PA_PSTREAM_DESCRIPTOR_CHANNEL] = htonl(p->write.current->channel);
p->write.descriptor[PA_PSTREAM_DESCRIPTOR_DELTA] = htonl(p->write.current->delta);
assert(p->write.data);
if (p->write.index < PA_PSTREAM_DESCRIPTOR_SIZE) {
- d = (void*) p->write.descriptor + p->write.index;
+ d = (uint8_t*) p->write.descriptor + p->write.index;
l = PA_PSTREAM_DESCRIPTOR_SIZE - p->write.index;
} else {
- d = (void*) p->write.data + p->write.index - PA_PSTREAM_DESCRIPTOR_SIZE;
+ d = (uint8_t*) p->write.data + p->write.index - PA_PSTREAM_DESCRIPTOR_SIZE;
l = ntohl(p->write.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]) - (p->write.index - PA_PSTREAM_DESCRIPTOR_SIZE);
}
assert(p);
if (p->read.index < PA_PSTREAM_DESCRIPTOR_SIZE) {
- d = (void*) p->read.descriptor + p->read.index;
+ d = (uint8_t*) p->read.descriptor + p->read.index;
l = PA_PSTREAM_DESCRIPTOR_SIZE - p->read.index;
} else {
assert(p->read.data);
- d = (void*) p->read.data + p->read.index - PA_PSTREAM_DESCRIPTOR_SIZE;
+ d = (uint8_t*) p->read.data + p->read.index - PA_PSTREAM_DESCRIPTOR_SIZE;
l = ntohl(p->read.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]) - (p->read.index - PA_PSTREAM_DESCRIPTOR_SIZE);
}
r->i_buf = pa_xrealloc(r->i_buf, sizeof(float) * (r->i_alloc = eff_ins));
assert(r->i_buf);
- r->to_float32_func(eff_ins, in->memblock->data+in->index, i_nchannels, r->i_buf);
+ r->to_float32_func(eff_ins, (uint8_t*) in->memblock->data+in->index, i_nchannels, r->i_buf);
if (r->src_state) {
int ret;
} else
cbuf = r->i_buf;
- r->from_float32_func(eff_ons, cbuf, out->memblock->data+out->index, o_nchannels);
+ r->from_float32_func(eff_ons, cbuf, (uint8_t*)out->memblock->data+out->index, o_nchannels);
out->length = ons*r->o_sz;
}
void pa_silence_memchunk(struct pa_memchunk *c, const struct pa_sample_spec *spec) {
assert(c && c->memblock && c->memblock->data && spec && c->length);
- pa_silence_memory(c->memblock->data+c->index, c->length, spec);
+ pa_silence_memory((uint8_t*) c->memblock->data+c->index, c->length, spec);
}
void pa_silence_memory(void *p, size_t length, const struct pa_sample_spec *spec) {
if (volume == PA_VOLUME_MUTED)
v = 0;
else {
- v = *((int16_t*) (channels[c].chunk.memblock->data + channels[c].chunk.index + d));
+ v = *((int16_t*) ((uint8_t*) channels[c].chunk.memblock->data + channels[c].chunk.index + d));
if (volume != PA_VOLUME_NORM)
v = (int32_t) ((float)v*volume/PA_VOLUME_NORM);
if (sum > 0x7FFF) sum = 0x7FFF;
*((int16_t*) data) = sum;
- data += sizeof(int16_t);
+ data = (uint8_t*) data + sizeof(int16_t);
}
}
return;
}
- for (d = (c->memblock->data+c->index), n = c->length/sizeof(int16_t); n > 0; d++, n--) {
+ for (d = (int16_t*) ((uint8_t*) c->memblock->data+c->index), n = c->length/sizeof(int16_t); n > 0; d++, n--) {
int32_t t = (int32_t)(*d);
t *= volume;
static void do_call(struct pa_socket_client *c) {
struct pa_iochannel *io = NULL;
- int error, lerror;
+ int error;
+ socklen_t lerror;
assert(c && c->callback);
pa_socket_client_ref(c);
struct chunk {
struct chunk *next;
size_t length;
- char text[0];
+ char text[];
};
struct pa_strbuf {