summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-10 03:33:27 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-10 03:33:27 +0100
commitb6804eefea4697d594210502b19f8370771e2a22 (patch)
tree8533a239623014ffd8b1746f7acf3bbc75e0fbd1 /src/utils
parent8a3dc57df2c90f9f27325998033db996b8fa5cfb (diff)
Make sure we don't drop any data on the client side
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/pacat.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index ea736e23..b1e0d1f4 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);
}