summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorVolker RĂ¼melin2022-03-01 20:13:10 +0100
committerGerd Hoffmann2022-03-04 11:05:13 +0100
commitacf7a705980d157735242cf3bedabd2ef22c5384 (patch)
treed60ee152336c986717bba59bfb799c920ecc609b /audio
parentossaudio: reduce effective playback buffer size (diff)
downloadqemu-acf7a705980d157735242cf3bedabd2ef22c5384.tar.gz
qemu-acf7a705980d157735242cf3bedabd2ef22c5384.tar.xz
qemu-acf7a705980d157735242cf3bedabd2ef22c5384.zip
paaudio: fix samples vs. frames mix-up
Now that the mixing buffer size no longer adds to playback latency, fix the samples vs. frames mix-up in the mixing buffer size calculation. This change will go largely unnoticed as long as the user doesn't use a buffer-size smaller than timer-period. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-14-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/paaudio.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/audio/paaudio.c b/audio/paaudio.c
index d94f858ec7..a53ed85e0b 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -549,11 +549,8 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as,
}
audio_pcm_init_info (&hw->info, &obt_as);
- /*
- * This is wrong. hw->samples counts in frames. hw->samples will be
- * number of channels times larger than expected.
- */
- hw->samples = audio_buffer_samples(
+ /* hw->samples counts in frames */
+ hw->samples = audio_buffer_frames(
qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440);
return 0;
@@ -601,11 +598,8 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
}
audio_pcm_init_info (&hw->info, &obt_as);
- /*
- * This is wrong. hw->samples counts in frames. hw->samples will be
- * number of channels times larger than expected.
- */
- hw->samples = audio_buffer_samples(
+ /* hw->samples counts in frames */
+ hw->samples = audio_buffer_frames(
qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440);
return 0;