[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/12] audio: fix audio_generic_read
From: |
Gerd Hoffmann |
Subject: |
[PULL 03/12] audio: fix audio_generic_read |
Date: |
Fri, 7 Feb 2020 08:45:48 +0100 |
From: Volker RĂ¼melin <address@hidden>
It seems the function audio_generic_read started as a copy of
function audio_generic_write and some necessary changes were
forgotten. Fix the mixed up source and destination pointers and
rename misnamed variables.
Signed-off-by: Volker RĂ¼melin <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
audio/audio.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index 7226aa64ff93..9cd76a331d7a 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1481,12 +1481,12 @@ size_t audio_generic_write(HWVoiceOut *hw, void *buf,
size_t size)
size_t audio_generic_read(HWVoiceIn *hw, void *buf, size_t size)
{
- size_t dst_size, copy_size;
- void *dst = hw->pcm_ops->get_buffer_in(hw, &dst_size);
- copy_size = MIN(size, dst_size);
+ size_t src_size, copy_size;
+ void *src = hw->pcm_ops->get_buffer_in(hw, &src_size);
+ copy_size = MIN(size, src_size);
- memcpy(dst, buf, copy_size);
- hw->pcm_ops->put_buffer_in(hw, buf, copy_size);
+ memcpy(buf, src, copy_size);
+ hw->pcm_ops->put_buffer_in(hw, src, copy_size);
return copy_size;
}
--
2.18.1
- [PULL 00/12] Audio 20200207 patches, Gerd Hoffmann, 2020/02/07
- [PULL 02/12] audio: fix audio_generic_write, Gerd Hoffmann, 2020/02/07
- [PULL 04/12] paaudio: remove unused variables, Gerd Hoffmann, 2020/02/07
- [PULL 01/12] audio/oss: fix buffer pos calculation, Gerd Hoffmann, 2020/02/07
- [PULL 05/12] audio: prevent SIGSEGV in AUD_get_buffer_size_out, Gerd Hoffmann, 2020/02/07
- [PULL 03/12] audio: fix audio_generic_read,
Gerd Hoffmann <=
- [PULL 07/12] ossaudio: prevent SIGSEGV in oss_enable_out, Gerd Hoffmann, 2020/02/07
- [PULL 08/12] ossaudio: disable poll mode can't be reached, Gerd Hoffmann, 2020/02/07
- [PULL 11/12] coreaudio: fix coreaudio playback, Gerd Hoffmann, 2020/02/07
- [PULL 09/12] audio: audio_generic_get_buffer_in should honor *size, Gerd Hoffmann, 2020/02/07
- [PULL 06/12] audio: fix bug 1858488, Gerd Hoffmann, 2020/02/07
- [PULL 12/12] audio: proper support for float samples in mixeng, Gerd Hoffmann, 2020/02/07
- [PULL 10/12] audio/dsound: fix invalid parameters error, Gerd Hoffmann, 2020/02/07
- Re: [PULL 00/12] Audio 20200207 patches, Peter Maydell, 2020/02/07