[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/23] audio: break generic buffer dependency on mixing-engine
From: |
Volker Rümelin |
Subject: |
[PATCH 10/23] audio: break generic buffer dependency on mixing-engine |
Date: |
Sun, 10 Jan 2021 11:02:26 +0100 |
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>
---
audio/audio.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index 480b3cce1f..22d769db0c 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.26.2
- [PATCH 05/23] sdlaudio: always clear the sample buffer, (continued)
- [PATCH 05/23] sdlaudio: always clear the sample buffer, Volker Rümelin, 2021/01/10
- [PATCH 06/23] sdlaudio: fill remaining sample buffer with silence, Volker Rümelin, 2021/01/10
- [PATCH 07/23] sdlaudio: replace legacy functions with modern ones, Volker Rümelin, 2021/01/10
- [PATCH 03/23] sdlaudio: add -audiodev sdl,out.buffer-count option, Volker Rümelin, 2021/01/10
- [PATCH 10/23] audio: break generic buffer dependency on mixing-engine,
Volker Rümelin <=
- [PATCH 08/23] audio: split pcm_ops function get_buffer_in, Volker Rümelin, 2021/01/10
- [PATCH 09/23] sdlaudio: add recording functions, Volker Rümelin, 2021/01/10
- [PATCH 11/23] sdlaudio: enable (in|out).mixing-engine=off, Volker Rümelin, 2021/01/10
- [PATCH 13/23] paaudio: avoid to clip samples multiple times, Volker Rümelin, 2021/01/10
- [PATCH 14/23] paaudio: wait for PA_STREAM_READY in qpa_write(), Volker Rümelin, 2021/01/10
- [PATCH 15/23] paaudio: wait until the playback stream is ready, Volker Rümelin, 2021/01/10
- [PATCH 12/23] audio: remove remaining unused plive code, Volker Rümelin, 2021/01/10
- [PATCH 16/23] paaudio: remove unneeded code, Volker Rümelin, 2021/01/10
- [PATCH 18/23] paaudio: limit minreq to 75% of audio timer_rate, Volker Rümelin, 2021/01/10
- [PATCH 20/23] dsoundaudio: replace GetForegroundWindow(), Volker Rümelin, 2021/01/10