[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic |
Date: |
Tue, 31 Jan 2017 12:16:20 +0000 |
Hi
On Tue, Jan 31, 2017 at 4:03 PM Pavel Dovgalyuk <address@hidden>
wrote:
> This patch changes resetting strategy of the audio polling timer.
> It does not change expiration time if the timer is already set.
>
>
You describe the change, but could you explain the reasons you propose it?
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
> 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);
>
>
> --
Marc-André Lureau