mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
examples: always use last buffers
Skip buffers and always use the last buffer in the queue. This compensates for slow reading clients.
This commit is contained in:
parent
b9916ea5b2
commit
b60d7bf2bc
2 changed files with 20 additions and 2 deletions
|
|
@ -100,7 +100,16 @@ on_process(void *_data, struct spa_io_position *position)
|
|||
uint32_t i, j;
|
||||
uint8_t *src, *dst;
|
||||
|
||||
if ((b = pw_filter_dequeue_buffer(data->in_port)) == NULL) {
|
||||
b = NULL;
|
||||
while (true) {
|
||||
struct pw_buffer *t;
|
||||
if ((t = pw_filter_dequeue_buffer(data->in_port)) == NULL)
|
||||
break;
|
||||
if (b)
|
||||
pw_filter_queue_buffer(data->in_port, b);
|
||||
b = t;
|
||||
}
|
||||
if (b == NULL) {
|
||||
pw_log_warn("out of buffers: %m");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue