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 <dirty.ice...@gmail.com> 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