summaryrefslogtreecommitdiffstats
path: root/src/modules/rtp
diff options
context:
space:
mode:
authorColin Guthrie <pulse@colin.guthr.ie>2008-05-26 23:43:51 +0000
committerColin Guthrie <pulse@colin.guthr.ie>2008-10-08 20:32:09 +0100
commit13bc07587564977a64222f5a4075b7fa63ac5548 (patch)
tree76e0376d857adb65454e52b326b42245b89c4603 /src/modules/rtp
parentb93e9e80ecbdc90c0bf6f90c5bd4aafcdb4d2488 (diff)
A few related changes:
* Change the encode_sample routine to simply return normal memchunks allocated from the mempool. * unref the memchunks returned from encode_sample when we are done with them. * Create an encoded 'silence' sample and play this at all times to prevent hangup and to 'hog' the airtunes device This now works and can be used as a regular sink albeit with a constant latency of about 8 seconds :s git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2485 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/rtp')
-rw-r--r--src/modules/rtp/raop_client.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/modules/rtp/raop_client.c b/src/modules/rtp/raop_client.c
index 7ba1be74..4085a494 100644
--- a/src/modules/rtp/raop_client.c
+++ b/src/modules/rtp/raop_client.c
@@ -94,12 +94,6 @@ struct pa_raop_client {
void* userdata;
pa_raop_client_closed_cb_t closed_callback;
void* closed_userdata;
-
- uint8_t *buffer;
- pa_memblock *memblock;
- size_t buffer_length;
- uint8_t *buffer_index;
- uint16_t buffer_count;
};
/**
@@ -402,7 +396,6 @@ void pa_raop_client_free(pa_raop_client* c)
{
pa_assert(c);
- pa_xfree(c->buffer);
if (c->rtsp)
pa_rtsp_client_free(c->rtsp);
pa_xfree(c->host);
@@ -443,15 +436,8 @@ int pa_raop_client_encode_sample(pa_raop_client* c, pa_memchunk* raw, pa_memchun
/* Leave 16 bytes extra to allow for the ALAC header which is about 55 bits */
bufmax = length + header_size + 16;
- if (bufmax > c->buffer_length) {
- c->buffer = pa_xrealloc(c->buffer, bufmax);
- c->buffer_length = bufmax;
- if (c->memblock)
- pa_memblock_unref(c->memblock);
- c->memblock = pa_memblock_new_user(c->core->mempool, c->buffer, bufmax, noop, 0);
- }
pa_memchunk_reset(encoded);
- encoded->memblock = c->memblock;
+ encoded->memblock = pa_memblock_new(c->core->mempool, bufmax);
b = pa_memblock_acquire(encoded->memblock);
memcpy(b, header, header_size);