aboutsummaryrefslogtreecommitdiff
path: root/audio/audio_int.h
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-09-19 23:24:20 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-09-23 12:28:47 +0200
commitdc88e38fa7f7480becf34712eae41380b62aacc6 (patch)
tree9839c0e6a46c0749b476829fbcdd5c29e81a0e11 /audio/audio_int.h
parent3f5bbfc25a16d251da79429b69131dc4075a5f37 (diff)
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>
Diffstat (limited to 'audio/audio_int.h')
-rw-r--r--audio/audio_int.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/audio/audio_int.h b/audio/audio_int.h
index c76d7c39e8..20021df9e8 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -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;