From c504851dca833df4af6ce83bf917604b768da01b Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Thu, 7 Dec 2023 13:08:39 +0100 Subject: [PATCH] alsa-compress-offload-sink: Improve write_queued_output_buffers comments --- spa/plugins/alsa/alsa-compress-offload-sink.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spa/plugins/alsa/alsa-compress-offload-sink.c b/spa/plugins/alsa/alsa-compress-offload-sink.c index 1477b5e4d..c9691a18f 100644 --- a/spa/plugins/alsa/alsa-compress-offload-sink.c +++ b/spa/plugins/alsa/alsa-compress-offload-sink.c @@ -967,11 +967,15 @@ static int write_queued_output_buffers(struct impl *this) * If during the write attempts, only a portion of a chunk * is written, we must keep track of the portion that hasn't * been consumed yet. offset_within_oldest_output_buffer - * exists for this purpose. In this sink node, each SPA - * buffer has exactly one chunk, so when a chunk is fully - * consumed, the corresponding buffer is removed from the - * queued_output_buffers list, marked as available, and - * returned to the pool through spa_node_call_reuse_buffer(). */ + * exists for this purpose. This can happen when the + * device_write() call below returns 0. The loop is then + * aborted, and the chunk is not fully written. + * + * In this sink node, each SPA buffer has exactly one chunk, + * so when a chunk is fully consumed, the corresponding buffer + * is removed from the queued_output_buffers list, marked as + * available, and returned to the pool through + * spa_node_call_reuse_buffer(). */ again: total_num_written_bytes = 0;