Skip to content

Commit

Permalink
audio: break generic buffer dependency on mixing-engine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Volker Rümelin authored and kraxel committed Jan 15, 2021
1 parent c2031de commit 1d8549a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions audio/audio.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1d8549a

Please sign in to comment.