[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/30] audio: break generic buffer dependency on mixing-engine
From: |
Gerd Hoffmann |
Subject: |
[PULL 10/30] audio: break generic buffer dependency on mixing-engine |
Date: |
Fri, 15 Jan 2021 14:21:26 +0100 |
From: Volker RĂ¼melin <vr_qemu@t-online.de>
Break the unnecessary dependency of the generic buffer management
code on mixing-engine. This is required for the next patch.
Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-10-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
audio/audio.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index 480b3cce1ffb..22d769db0c99 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1388,9 +1388,8 @@ void audio_run(AudioState *s, const char *msg)
void audio_generic_run_buffer_in(HWVoiceIn *hw)
{
if (unlikely(!hw->buf_emul)) {
- size_t calc_size = hw->conv_buf->size * hw->info.bytes_per_frame;
- hw->buf_emul = g_malloc(calc_size);
- hw->size_emul = calc_size;
+ hw->size_emul = hw->samples * hw->info.bytes_per_frame;
+ hw->buf_emul = g_malloc(hw->size_emul);
hw->pos_emul = hw->pending_emul = 0;
}
@@ -1452,10 +1451,8 @@ void audio_generic_run_buffer_out(HWVoiceOut *hw)
void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size)
{
if (unlikely(!hw->buf_emul)) {
- size_t calc_size = hw->mix_buf->size * hw->info.bytes_per_frame;
-
- hw->buf_emul = g_malloc(calc_size);
- hw->size_emul = calc_size;
+ hw->size_emul = hw->samples * hw->info.bytes_per_frame;
+ hw->buf_emul = g_malloc(hw->size_emul);
hw->pos_emul = hw->pending_emul = 0;
}
--
2.29.2
- [PULL 00/30] Audio 20210115 patches, Gerd Hoffmann, 2021/01/15
- [PULL 02/30] audio: fix bit-rotted code, Gerd Hoffmann, 2021/01/15
- [PULL 01/30] sdlaudio: remove leftover SDL1.2 code, Gerd Hoffmann, 2021/01/15
- [PULL 10/30] audio: break generic buffer dependency on mixing-engine,
Gerd Hoffmann <=
- [PULL 20/30] dsoundaudio: replace GetForegroundWindow(), Gerd Hoffmann, 2021/01/15
- [PULL 11/30] sdlaudio: enable (in|out).mixing-engine=off, Gerd Hoffmann, 2021/01/15
- [PULL 08/30] audio: split pcm_ops function get_buffer_in, Gerd Hoffmann, 2021/01/15
- [PULL 18/30] paaudio: limit minreq to 75% of audio timer_rate, Gerd Hoffmann, 2021/01/15
- [PULL 03/30] sdlaudio: add -audiodev sdl,out.buffer-count option, Gerd Hoffmann, 2021/01/15
- [PULL 22/30] dsoundaudio: enable f32 audio sample format, Gerd Hoffmann, 2021/01/15
- [PULL 05/30] sdlaudio: always clear the sample buffer, Gerd Hoffmann, 2021/01/15
- [PULL 04/30] sdlaudio: don't start playback in init routine, Gerd Hoffmann, 2021/01/15
- [PULL 12/30] audio: remove remaining unused plive code, Gerd Hoffmann, 2021/01/15
- [PULL 15/30] paaudio: wait until the playback stream is ready, Gerd Hoffmann, 2021/01/15