[Spice-devel] [PATCH spice-server 4/4] test-playback: Simplify wave generation formulae

Uri Lublin uril at redhat.com
Tue Dec 25 09:29:02 UTC 2018


remove the last e above

On 12/21/18 10:58 AM, Frediano Ziglio wrote:
> Split level computation, make clear is a sine wave on both channels.

I don't understand what you mean in the second part of the sentence.

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>

Uri.

> ---
>   server/tests/test-playback.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
> index 87469c8e..290c8609 100644
> --- a/server/tests/test-playback.c
> +++ b/server/tests/test-playback.c
> @@ -89,7 +89,8 @@ static void playback_timer_cb(SPICE_GNUC_UNUSED void *opaque)
>       while (samples_to_send > num_samples && frame) {
>           samples_to_send -= num_samples;
>           for (i = 0 ; i < num_samples; ++i) {
> -            frame[i] = (((uint16_t)((1<<14)*sin((t+i)/10))) << 16) + (((uint16_t)((1<<14)*sin((t+i)/10))));
> +            uint16_t level = (1<<14) * sin((t+i)/10.0);
> +            frame[i] = (level << 16) + level;
>           }
>           t += num_samples;
>           spice_server_playback_put_samples(&playback_instance, frame);
> 



More information about the Spice-devel mailing list