audio: unify input and output mixeng buffer management

Usage notes: hw->samples became hw->{mix,conv}_buf->size, except before
initialization (audio_pcm_hw_alloc_resources_*), hw->samples gives the
initial size of the STSampleBuffer.  The next commit tries to fix this
inconsistency.

Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Message-id: a78caeb2eeb6348ecb45bb2c81709570ef8ac5b3.1568927990.git.DirtY.iCE.hu@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Kővágó, Zoltán
2019-09-19 23:24:20 +02:00
committed by Gerd Hoffmann
parent 3f5bbfc25a
commit dc88e38fa7
4 changed files with 80 additions and 76 deletions

View File

@ -52,6 +52,11 @@ struct audio_pcm_info {
typedef struct AudioState AudioState;
typedef struct SWVoiceCap SWVoiceCap;
typedef struct STSampleBuffer {
size_t pos, size;
st_sample samples[];
} STSampleBuffer;
typedef struct HWVoiceOut {
AudioState *s;
int enabled;
@ -60,11 +65,9 @@ typedef struct HWVoiceOut {
struct audio_pcm_info info;
f_sample *clip;
size_t rpos;
uint64_t ts_helper;
struct st_sample *mix_buf;
STSampleBuffer *mix_buf;
void *buf_emul;
size_t pos_emul, pending_emul, size_emul;
@ -84,11 +87,10 @@ typedef struct HWVoiceIn {
t_sample *conv;
size_t wpos;
size_t total_samples_captured;
uint64_t ts_helper;
struct st_sample *conv_buf;
STSampleBuffer *conv_buf;
void *buf_emul;
size_t pos_emul, pending_emul, size_emul;