From 7ffc90f3ae3d84562a4bda63cde961000b335542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20R=C3=BCmelin?= Date: Tue, 19 Nov 2019 07:58:49 +0100 Subject: [PATCH] audio: fix audio recording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With current code audio recording with all audio backends except PulseAudio and DirectSound is broken. The generic audio recording buffer management forgot to update the current read position after a read. Fixes: ff095e5231 "audio: api for mixeng code free backends" Signed-off-by: Volker Rümelin Reviewed-by: Zoltán Kővágó Message-id: 2fc947cf-7b42-de68-3f11-cbcf1c096be9@t-online.de Signed-off-by: Gerd Hoffmann --- audio/audio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/audio.c b/audio/audio.c index 7fc3aa9d16..56fae55047 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1390,6 +1390,7 @@ void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size) size_t read = hw->pcm_ops->read(hw, hw->buf_emul + hw->pos_emul, read_len); hw->pending_emul += read; + hw->pos_emul = (hw->pos_emul + read) % hw->size_emul; if (read < read_len) { break; }