audio: swap audio_rate_get_bytes() function parameters
Swap the rate and info parameters of the audio_rate_get_bytes() function to align the parameter order with the rest of the audio_rate_*() functions. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220923183640.8314-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
70ded68b45
commit
613fe02b2a
@ -2276,7 +2276,7 @@ void audio_rate_add_bytes(RateCtl *rate, size_t bytes_used)
|
||||
rate->bytes_sent += bytes_used;
|
||||
}
|
||||
|
||||
size_t audio_rate_get_bytes(struct audio_pcm_info *info, RateCtl *rate,
|
||||
size_t audio_rate_get_bytes(RateCtl *rate, struct audio_pcm_info *info,
|
||||
size_t bytes_avail)
|
||||
{
|
||||
size_t bytes;
|
||||
|
@ -265,7 +265,7 @@ typedef struct RateCtl {
|
||||
void audio_rate_start(RateCtl *rate);
|
||||
size_t audio_rate_peek_bytes(RateCtl *rate, struct audio_pcm_info *info);
|
||||
void audio_rate_add_bytes(RateCtl *rate, size_t bytes_used);
|
||||
size_t audio_rate_get_bytes(struct audio_pcm_info *info, RateCtl *rate,
|
||||
size_t audio_rate_get_bytes(RateCtl *rate, struct audio_pcm_info *info,
|
||||
size_t bytes_avail);
|
||||
|
||||
static inline size_t audio_ring_dist(size_t dst, size_t src, size_t len)
|
||||
|
@ -82,7 +82,7 @@ static void *dbus_get_buffer_out(HWVoiceOut *hw, size_t *size)
|
||||
}
|
||||
|
||||
*size = MIN(vo->buf_size - vo->buf_pos, *size);
|
||||
*size = audio_rate_get_bytes(&hw->info, &vo->rate, *size);
|
||||
*size = audio_rate_get_bytes(&vo->rate, &hw->info, *size);
|
||||
|
||||
return vo->buf + vo->buf_pos;
|
||||
|
||||
@ -343,7 +343,7 @@ dbus_read(HWVoiceIn *hw, void *buf, size_t size)
|
||||
|
||||
trace_dbus_audio_read(size);
|
||||
|
||||
/* size = audio_rate_get_bytes(&hw->info, &vo->rate, size); */
|
||||
/* size = audio_rate_get_bytes(&vo->rate, &hw->info, size); */
|
||||
|
||||
g_hash_table_iter_init(&iter, da->in_listeners);
|
||||
while (g_hash_table_iter_next(&iter, NULL, (void **)&listener)) {
|
||||
|
@ -44,7 +44,7 @@ typedef struct NoVoiceIn {
|
||||
static size_t no_write(HWVoiceOut *hw, void *buf, size_t len)
|
||||
{
|
||||
NoVoiceOut *no = (NoVoiceOut *) hw;
|
||||
return audio_rate_get_bytes(&hw->info, &no->rate, len);
|
||||
return audio_rate_get_bytes(&no->rate, &hw->info, len);
|
||||
}
|
||||
|
||||
static int no_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque)
|
||||
@ -89,7 +89,7 @@ static void no_fini_in (HWVoiceIn *hw)
|
||||
static size_t no_read(HWVoiceIn *hw, void *buf, size_t size)
|
||||
{
|
||||
NoVoiceIn *no = (NoVoiceIn *) hw;
|
||||
int64_t bytes = audio_rate_get_bytes(&hw->info, &no->rate, size);
|
||||
int64_t bytes = audio_rate_get_bytes(&no->rate, &hw->info, size);
|
||||
|
||||
audio_pcm_info_clear_buf(&hw->info, buf, bytes / hw->info.bytes_per_frame);
|
||||
return bytes;
|
||||
|
@ -239,7 +239,7 @@ static void line_in_fini (HWVoiceIn *hw)
|
||||
static size_t line_in_read(HWVoiceIn *hw, void *buf, size_t len)
|
||||
{
|
||||
SpiceVoiceIn *in = container_of (hw, SpiceVoiceIn, hw);
|
||||
uint64_t to_read = audio_rate_get_bytes(&hw->info, &in->rate, len) >> 2;
|
||||
uint64_t to_read = audio_rate_get_bytes(&in->rate, &hw->info, len) >> 2;
|
||||
size_t ready = spice_server_record_get_samples(&in->sin, buf, to_read);
|
||||
|
||||
/*
|
||||
|
@ -42,7 +42,7 @@ typedef struct WAVVoiceOut {
|
||||
static size_t wav_write_out(HWVoiceOut *hw, void *buf, size_t len)
|
||||
{
|
||||
WAVVoiceOut *wav = (WAVVoiceOut *) hw;
|
||||
int64_t bytes = audio_rate_get_bytes(&hw->info, &wav->rate, len);
|
||||
int64_t bytes = audio_rate_get_bytes(&wav->rate, &hw->info, len);
|
||||
assert(bytes % hw->info.bytes_per_frame == 0);
|
||||
|
||||
if (bytes && fwrite(buf, bytes, 1, wav->f) != 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user