qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: "Kővágó Zoltán" <dirty.ice.hu@gmail.com>
Subject: Re: [PATCH] audio/oss: fix buffer pos calculation
Date: Mon, 20 Jan 2020 12:12:02 +0100	[thread overview]
Message-ID: <37383db5-0a9a-4431-663e-3c20472abeb1@redhat.com> (raw)
In-Reply-To: <20200120101804.29578-1-kraxel@redhat.com>

On 1/20/20 11:18 AM, Gerd Hoffmann wrote:
> Fixes: 3ba4066d085f ("ossaudio: port to the new audio backend api")
> Reported-by: ziming zhang <ezrakiez@gmail.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   audio/ossaudio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/audio/ossaudio.c b/audio/ossaudio.c
> index c43faeeea4aa..94564916fbf0 100644
> --- a/audio/ossaudio.c
> +++ b/audio/ossaudio.c
> @@ -420,7 +420,7 @@ static size_t oss_write(HWVoiceOut *hw, void *buf, size_t len)
>               size_t to_copy = MIN(len, hw->size_emul - hw->pos_emul);
>               memcpy(hw->buf_emul + hw->pos_emul, buf, to_copy);
>   
> -            hw->pos_emul = (hw->pos_emul + to_copy) % hw->pos_emul;
> +            hw->pos_emul = (hw->pos_emul + to_copy) % hw->size_emul;

Interestingly oss_put_buffer_out() is correct.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>               buf += to_copy;
>               len -= to_copy;
>           }
> 



      reply	other threads:[~2020-01-20 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 10:18 [PATCH] audio/oss: fix buffer pos calculation Gerd Hoffmann
2020-01-20 11:12 ` Philippe Mathieu-Daudé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37383db5-0a9a-4431-663e-3c20472abeb1@redhat.com \
    --to=philmd@redhat.com \
    --cc=dirty.ice.hu@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).