qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 09/11] virtio-sound: implement audio output (TX)


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v10 09/11] virtio-sound: implement audio output (TX)
Date: Tue, 3 Oct 2023 16:27:59 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

Hi Manos,

On 29/9/23 20:59, Manos Pitsidianakis wrote:
On Fri, 29 Sep 2023 17:08, Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> 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

[Prev in Thread] Current Thread [Next in Thread]