diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-01-10 03:33:27 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-01-10 03:33:27 +0100 |
commit | b6804eefea4697d594210502b19f8370771e2a22 (patch) | |
tree | 8533a239623014ffd8b1746f7acf3bbc75e0fbd1 /src/utils/pacat.c | |
parent | 8a3dc57df2c90f9f27325998033db996b8fa5cfb (diff) | |
download | pulseaudio-b6804eefea4697d594210502b19f8370771e2a22.tar.gz |
Make sure we don't drop any data on the client side
Diffstat (limited to 'src/utils/pacat.c')
-rw-r--r-- | src/utils/pacat.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c index ea736e237..b1e0d1f47 100644 --- a/src/utils/pacat.c +++ b/src/utils/pacat.c @@ -139,17 +139,16 @@ static void stream_read_callback(pa_stream *s, size_t length, void *userdata) { assert(length > 0); if (buffer) { - fprintf(stderr, _("Buffer overrun, dropping incoming data\n")); - if (pa_stream_drop(s) < 0) { - fprintf(stderr, _("pa_stream_drop() failed: %s\n"), pa_strerror(pa_context_errno(context))); - quit(1); - } - return; + buffer = pa_xrealloc(buffer, buffer_length + length); + memcpy((uint8_t*) buffer + buffer_length, data, length); + buffer_length += length; + } else { + buffer = pa_xmalloc(length); + memcpy(buffer, data, length); + buffer_length = length; + buffer_index = 0; } - buffer = pa_xmalloc(buffer_length = length); - memcpy(buffer, data, length); - buffer_index = 0; pa_stream_drop(s); } |