Hi Manos,

On 29/9/23 20:59, Manos Pitsidianakis wrote:
On Fri, 29 Sep 2023 17:08, Emmanouil Pitsidianakis <[email protected]> wrote:
Handle output IO messages in the transmit (TX) virtqueue.
[..]
+            if (!stream->active) {
+                /* Stream has stopped, so do not perform AUD_write. */
+                goto return_tx_buffer;
+            }
[..]
+return_tx_buffer:
+                    virtio_snd_pcm_status resp = { 0 };
+                    resp.status = cpu_to_le32(VIRTIO_SND_S_OK);


It seems I was too hasty to submit this patch. It does not build with clang on macos because it does not allow labels before declarations.

It needs the following changes to compile:

--- a/hw/virtio/virtio-snd.c
+++ b/hw/virtio/virtio-snd.c
@@ -1187,7 +1187,7 @@ static void virtio_snd_pcm_out_cb(void *data, int available)
                 buffer->offset += size;
                 available -= size;
                 if (buffer->size < 1) {
-return_tx_buffer:
+return_tx_buffer:;
                     virtio_snd_pcm_status resp = { 0 };
                     resp.status = cpu_to_le32(VIRTIO_SND_S_OK);
                     resp.latency_bytes = 0;


Extract a tiny return_tx_buffer() function, which you can then
call in the 2 different places.

Reply via email to