diff --git a/src/examples/video-dsp-play.c b/src/examples/video-dsp-play.c index 42c19064f..c76f6c248 100644 --- a/src/examples/video-dsp-play.c +++ b/src/examples/video-dsp-play.c @@ -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; } diff --git a/src/examples/video-play.c b/src/examples/video-play.c index 46ef446f5..546df19a9 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -104,7 +104,16 @@ on_process(void *_data) uint8_t *src, *dst; bool render_cursor = false; - if ((b = pw_stream_dequeue_buffer(stream)) == NULL) { + b = NULL; + while (true) { + struct pw_buffer *t; + if ((t = pw_stream_dequeue_buffer(stream)) == NULL) + break; + if (b) + pw_stream_queue_buffer(stream, b); + b = t; + } + if (b == NULL) { pw_log_warn("out of buffers: %m"); return; }