qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
@ 2017-01-31 11:59 Pavel Dovgalyuk
  2017-01-31 12:11 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pavel Dovgalyuk @ 2017-01-31 11:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, dovgaluk, kraxel

This patch changes resetting strategy of the audio polling timer.
It does not change expiration time if the timer is already set.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
 audio/audio.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/audio/audio.c b/audio/audio.c
index c845a44..1ee95a5 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
 static void audio_reset_timer (AudioState *s)
 {
     if (audio_is_timer_needed ()) {
-        timer_mod (s->ts,
-            qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+        if (!timer_pending(s->ts)) {
+            timer_mod (s->ts,
+                qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+        }
     }
     else {
         timer_del (s->ts);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-02-14 11:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 11:59 [Qemu-devel] [PATCH] audio: make audio poll timer deterministic Pavel Dovgalyuk
2017-01-31 12:11 ` no-reply
2017-01-31 12:16 ` Marc-André Lureau
2017-01-31 12:32   ` Pavel Dovgalyuk
2017-02-01 13:20     ` Gerd Hoffmann
2017-02-13  5:04 ` Pavel Dovgalyuk
2017-02-13 18:40   ` Yurii Zubrytskyi
2017-02-14 11:57     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).