qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 21/25] audio: common rate control code for timer


From: Kővágó Zoltán
Subject: Re: [Qemu-devel] [PATCH 21/25] audio: common rate control code for timer based outputs
Date: Fri, 21 Aug 2015 15:34:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Hi,

2015-08-21 00:37 keltezéssel, Marc-André Lureau írta:
Hi

On Thu, Aug 6, 2015 at 8:28 PM, Kővágó, Zoltán <address@hidden> wrote:

-    decr = rate_get_samples(&hw->info, &out->rate);
-    decr = audio_MIN(out->fsize - out->fpos, decr);
-
-    *size = decr << 2;
+    *size = audio_rate_get_bytes(&hw->info, &out->rate,
+                                 (out->fsize - out->fpos) << 2);
      return out->frame + out->fpos;
  }

I am not familiar with this "rate" thing, but you are changing the way
it works for Spice without explaining why, and that worries me a
little.

The rate->bytes_sent is not updated the same way, the result is not
always << 2..

I really don't get what this is really doing tbh, some kind of clever
buffer limit :)


The old code pretty much ignored if the buffer overflow (which shouldn't happen normally), while the new one doesn't. The problem is that with this new get_buffer/put_buffer thing if we reach the end of the circular buffer, it will produce have the same effect as a buffer overflow, but we need to handle it more gracefully as it will now happen every now and then.

But probably I'll change << 2 to info.shift, to handle more gracefully if the spice stream format changes.

Zoltan



reply via email to

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