OSDN Git Service

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

Replace the resampling loop in audio_pcm_sw_read() with the new
function audio_pcm_sw_resample_in(). 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-10-vr_qemu@t-online.de>
audio/audio.c