[Spice-commits] 4 commits - server/tests
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 25 10:24:09 UTC 2018
server/tests/test-playback.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
New commits:
commit 27fc91986db2970d3cc3b89bf16871e544356b06
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Dec 21 08:56:43 2018 +0000
test-playback: Simplify wave generation formulae
Split level computation, make clear is a sine wave on both channels.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
index 5eb97fa7..acd085db 100644
--- a/server/tests/test-playback.c
+++ b/server/tests/test-playback.c
@@ -90,7 +90,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);
commit cc9ddd6c1d9b3cab68d92b217e42cf1756148e64
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Dec 21 08:55:09 2018 +0000
test-playback: Remove obsolete debug
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
index 872d37a4..5eb97fa7 100644
--- a/server/tests/test-playback.c
+++ b/server/tests/test-playback.c
@@ -88,9 +88,6 @@ static void playback_timer_cb(SPICE_GNUC_UNUSED void *opaque)
}
last_sent_usec = cur_usec;
while (samples_to_send > num_samples && frame) {
-#if 0
- printf("samples_to_send = %d\n", samples_to_send);
-#endif
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))));
commit f76d0bffedde015759ca1e6d7d085d6d6c39ba8d
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Dec 21 08:54:47 2018 +0000
test-playback: Update misleading comments
We are waiting for a client connection, channel is already there
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
index e1d967c0..872d37a4 100644
--- a/server/tests/test-playback.c
+++ b/server/tests/test-playback.c
@@ -73,12 +73,12 @@ static void playback_timer_cb(SPICE_GNUC_UNUSED void *opaque)
get_frame();
if (!frame) {
- /* continue waiting until there is a channel */
+ /* continue waiting until there is a client */
core->timer_start(playback_timer, 100);
return;
}
- /* we have a channel */
+ /* we have a client */
gettimeofday(&cur, NULL);
cur_usec = cur.tv_usec + cur.tv_sec * 1e6;
if (last_sent_usec == 0) {
commit 10b93025f2990560e08b1810d4ef32552345c06a
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Dec 21 08:54:00 2018 +0000
test-playback: Remove useless check for "frame"
We just fill it up, can't be NULL.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Uri Lublin <uril at redhat.com>
diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
index 9b2dcc10..e1d967c0 100644
--- a/server/tests/test-playback.c
+++ b/server/tests/test-playback.c
@@ -96,10 +96,8 @@ static void playback_timer_cb(SPICE_GNUC_UNUSED void *opaque)
frame[i] = (((uint16_t)((1<<14)*sin((t+i)/10))) << 16) + (((uint16_t)((1<<14)*sin((t+i)/10))));
}
t += num_samples;
- if (frame) {
- spice_server_playback_put_samples(&playback_instance, frame);
- frame = NULL;
- }
+ spice_server_playback_put_samples(&playback_instance, frame);
+ frame = NULL;
get_frame();
}
core->timer_start(playback_timer, playback_timer_ms);
More information about the Spice-commits
mailing list