From a3ec0cf49e00d018236821bafd430fbffc036eec Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 2 Mar 2020 17:27:00 +0100 Subject: [PATCH] examples: improve some debug --- src/examples/audio-src.c | 4 +++- src/examples/video-dsp-play.c | 5 +++-- src/examples/video-play.c | 5 +++-- src/examples/video-src-alloc.c | 2 +- src/examples/video-src.c | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/examples/audio-src.c b/src/examples/audio-src.c index 5753ee6f5..95ee54fa9 100644 --- a/src/examples/audio-src.c +++ b/src/examples/audio-src.c @@ -79,8 +79,10 @@ static void on_process(void *userdata) int n_frames, stride; uint8_t *p; - if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) + if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { + pw_log_warn("out of buffers: %m"); return; + } buf = b->buffer; if ((p = buf->datas[0].data) == NULL) diff --git a/src/examples/video-dsp-play.c b/src/examples/video-dsp-play.c index 585af7d83..42c19064f 100644 --- a/src/examples/video-dsp-play.c +++ b/src/examples/video-dsp-play.c @@ -100,9 +100,10 @@ on_process(void *_data, struct spa_io_position *position) uint32_t i, j; uint8_t *src, *dst; - b = pw_filter_dequeue_buffer(data->in_port); - if (b == NULL) + if ((b = pw_filter_dequeue_buffer(data->in_port)) == NULL) { + pw_log_warn("out of buffers: %m"); return; + } buf = b->buffer; diff --git a/src/examples/video-play.c b/src/examples/video-play.c index 8747195a5..46ef446f5 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -104,9 +104,10 @@ on_process(void *_data) uint8_t *src, *dst; bool render_cursor = false; - b = pw_stream_dequeue_buffer(stream); - if (b == NULL) + if ((b = pw_stream_dequeue_buffer(stream)) == NULL) { + pw_log_warn("out of buffers: %m"); return; + } buf = b->buffer; diff --git a/src/examples/video-src-alloc.c b/src/examples/video-src-alloc.c index c82265bf6..68332fe82 100644 --- a/src/examples/video-src-alloc.c +++ b/src/examples/video-src-alloc.c @@ -96,7 +96,7 @@ static void on_timeout(void *userdata, uint64_t expirations) pw_log_trace("timeout"); if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { - pw_log_warn("out of buffers"); + pw_log_warn("out of buffers: %m"); return; } diff --git a/src/examples/video-src.c b/src/examples/video-src.c index 2fe056f65..2fe7c4e5b 100644 --- a/src/examples/video-src.c +++ b/src/examples/video-src.c @@ -95,7 +95,7 @@ static void on_timeout(void *userdata, uint64_t expirations) pw_log_trace("timeout"); if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { - pw_log_warn("out of buffers"); + pw_log_warn("out of buffers: %m"); return; }