audio: replace the resampling loop in audio_pcm_sw_write()
commit8a81abeeb2e17630c366fccbd99ce20eac328819
authorVolker Rümelin <vr_qemu@t-online.de>
Fri, 24 Feb 2023 19:05:44 +0000 (24 20:05 +0100)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 6 Mar 2023 06:30:23 +0000 (6 10:30 +0400)
tree74a721edbdd5368b740f1cc193b330a2c981b3e8
parent8933882da9c63a0b60706828e11f3c09e2a903c7
audio: replace the resampling loop in audio_pcm_sw_write()

Replace the resampling loop in audio_pcm_sw_write() with the new
function audio_pcm_sw_resample_out(). Unlike the old resample
loop the new function will try to consume input frames even if
the output buffer is full. This is necessary when downsampling
to avoid reading less audio frames than calculated in advance.
The loop was unrolled to avoid complicated loop control conditions
in this case.

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20230224190555.7409-4-vr_qemu@t-online.de>
audio/audio.c