Am 27.09.22 um 13:54 schrieb Marc-André Lureau:
On Fri, Sep 23, 2022 at 10:48 PM Volker Rümelin <vr_q...@t-online.de>
wrote:
The calculation of the buffer size needed to store audio samples
after resampling is wrong for audio recording. For audio recording
sw->ratio is calculated as
sw->ratio = frontend sample rate / backend sample rate.
>From this follows
frontend samples = frontend sample rate / backend sample rate
* backend samples
frontend samples = sw->ratio * backend samples
In 2 of 3 places in the audio recording code where sw->ratio
is used in a calculation to get the number of frontend frames,
the calculation is wrong. Fix this. The 3rd formula in
audio_pcm_sw_read() is correct.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/71
Signed-off-by: Volker Rümelin <vr_q...@t-online.de>
Would you mind adding the test to qtest?
lgtm
Acked-by: Marc-André Lureau <marcandre.lur...@redhat.com>
Hi Marc-André,
I will give it a try. But it will be a separate patch, because the test
from issue #71 now checks for the error at
https://lists.nongnu.org/archive/html/qemu-devel/2022-09/msg02347.html
and not the one from issue #71.
With best regards,
Volker