qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] audio/oss: fix buffer pos calculation


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] audio/oss: fix buffer pos calculation
Date: Mon, 20 Jan 2020 12:12:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 1/20/20 11:18 AM, Gerd Hoffmann wrote:
Fixes: 3ba4066d085f ("ossaudio: port to the new audio backend api")
Reported-by: ziming zhang <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
  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é <address@hidden>

              buf += to_copy;
              len -= to_copy;
          }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]