qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 03/11] audio: use a nominal volume of UINT_MAX


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH 03/11] audio: use a nominal volume of UINT_MAX
Date: Mon, 12 Mar 2012 22:28:23 +0100

On Mon, Mar 12, 2012 at 10:11 PM, malc <address@hidden> wrote:
>> AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol..)
>>
>> sw->vol.l = nominal_volume.l * lvol / 255;
>>
>> So the range was [0..2^8-1] and then it becomes [0..2^32], which looks
>> wrong to me.
>
> It actually becomes [-2^63..2^63-1] nominal_volume.l being 64 bit signed
> and all.

uint8_t [0..255] / 255 * 2^32 = [0..2^32]

>> And Spice uses [0..2^16-1]. So it is simpler to stay within the range
>> of an integer..
>
> I do not get you, i really don't.

The audio hw volume range is within a uint8 [0..2^8-1] that is then
scaled into a [0..2^32], it would be easier to stay within a
[0..2^n-1] range all the way.


-- 
Marc-André Lureau



reply via email to

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