examples: improve some debug

This commit is contained in:
Wim Taymans 2020-03-02 17:27:00 +01:00
parent fef0e17b76
commit a3ec0cf49e
5 changed files with 11 additions and 7 deletions

View file

@ -79,8 +79,10 @@ static void on_process(void *userdata)
int n_frames, stride; int n_frames, stride;
uint8_t *p; 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; return;
}
buf = b->buffer; buf = b->buffer;
if ((p = buf->datas[0].data) == NULL) if ((p = buf->datas[0].data) == NULL)

View file

@ -100,9 +100,10 @@ on_process(void *_data, struct spa_io_position *position)
uint32_t i, j; uint32_t i, j;
uint8_t *src, *dst; uint8_t *src, *dst;
b = pw_filter_dequeue_buffer(data->in_port); if ((b = pw_filter_dequeue_buffer(data->in_port)) == NULL) {
if (b == NULL) pw_log_warn("out of buffers: %m");
return; return;
}
buf = b->buffer; buf = b->buffer;

View file

@ -104,9 +104,10 @@ on_process(void *_data)
uint8_t *src, *dst; uint8_t *src, *dst;
bool render_cursor = false; bool render_cursor = false;
b = pw_stream_dequeue_buffer(stream); if ((b = pw_stream_dequeue_buffer(stream)) == NULL) {
if (b == NULL) pw_log_warn("out of buffers: %m");
return; return;
}
buf = b->buffer; buf = b->buffer;

View file

@ -96,7 +96,7 @@ static void on_timeout(void *userdata, uint64_t expirations)
pw_log_trace("timeout"); pw_log_trace("timeout");
if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) {
pw_log_warn("out of buffers"); pw_log_warn("out of buffers: %m");
return; return;
} }

View file

@ -95,7 +95,7 @@ static void on_timeout(void *userdata, uint64_t expirations)
pw_log_trace("timeout"); pw_log_trace("timeout");
if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) {
pw_log_warn("out of buffers"); pw_log_warn("out of buffers: %m");
return; return;
} }