mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
Make sure we don't drop any data on the client side
This commit is contained in:
parent
8a3dc57df2
commit
b6804eefea
1 changed files with 8 additions and 9 deletions
|
|
@ -139,17 +139,16 @@ static void stream_read_callback(pa_stream *s, size_t length, void *userdata) {
|
||||||
assert(length > 0);
|
assert(length > 0);
|
||||||
|
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
fprintf(stderr, _("Buffer overrun, dropping incoming data\n"));
|
buffer = pa_xrealloc(buffer, buffer_length + length);
|
||||||
if (pa_stream_drop(s) < 0) {
|
memcpy((uint8_t*) buffer + buffer_length, data, length);
|
||||||
fprintf(stderr, _("pa_stream_drop() failed: %s\n"), pa_strerror(pa_context_errno(context)));
|
buffer_length += length;
|
||||||
quit(1);
|
} else {
|
||||||
}
|
buffer = pa_xmalloc(length);
|
||||||
return;
|
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);
|
pa_stream_drop(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue