[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/9] audio: fix audio_generic_read
From: |
Volker Rümelin |
Subject: |
[PATCH 2/9] audio: fix audio_generic_read |
Date: |
Thu, 23 Jan 2020 08:49:36 +0100 |
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>
---
audio/audio.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index db44482342..bf0f01e17f 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1480,12 +1480,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.16.4
- [PATCH 0/9] more audio fixes and improvements, Volker Rümelin, 2020/01/23
- [PATCH 1/9] audio: fix audio_generic_write, Volker Rümelin, 2020/01/23
- [PATCH 2/9] audio: fix audio_generic_read,
Volker Rümelin <=
- [PATCH 3/9] paaudio: remove unused variables, Volker Rümelin, 2020/01/23
- [PATCH 5/9] audio: fix bug 1858488, Volker Rümelin, 2020/01/23
- [PATCH 4/9] audio: prevent SIGSEGV in AUD_get_buffer_size_out, Volker Rümelin, 2020/01/23
- [PATCH 7/9] ossaudio: prevent SIGPFE in oss_write, Volker Rümelin, 2020/01/23
- [PATCH 6/9] ossaudio: prevent SIGSEGV in oss_enable_out, Volker Rümelin, 2020/01/23
- [PATCH 8/9] ossaudio: disable poll mode can't be reached, Volker Rümelin, 2020/01/23
- [PATCH 9/9] audio: audio_generic_get_buffer_in should honor *size, Volker Rümelin, 2020/01/23
- Re: [PATCH 0/9] more audio fixes and improvements, Mark Cave-Ayland, 2020/01/27