1a01df3db8
Introduce the new function st_rate_frames_in() to calculate the exact number of audio input frames needed to get a given number of audio output frames. The exact number of frames depends only on the difference of opos - ipos and the number of output frames. When downsampling, this function returns the maximum number of input frames needed. This new function replaces the audio_frontend_frames_out() function, which calculated the average number of input frames rounded down to the nearest integer. Because audio_frontend_frames_out() also limited the number of input frames to the size of the resample buffer, st_rate_frames_in() is not a direct replacement and two additional MIN() functions are needed. One to prevent resample buffer overflows and one to limit the available bytes for the audio frontends. After this patch the audio packet length calculation for playback is exact. When upsampling, it's still possible that the audio frontends can't write the last audio frame. This will be fixed later. Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20230224190555.7409-9-vr_qemu@t-online.de> |
||
---|---|---|
.. | ||
alsaaudio.c | ||
audio_int.h | ||
audio_legacy.c | ||
audio_template.h | ||
audio_win_int.c | ||
audio_win_int.h | ||
audio-hmp-cmds.c | ||
audio.c | ||
audio.h | ||
coreaudio.m | ||
dbusaudio.c | ||
dsound_template.h | ||
dsoundaudio.c | ||
jackaudio.c | ||
meson.build | ||
mixeng_template.h | ||
mixeng.c | ||
mixeng.h | ||
noaudio.c | ||
ossaudio.c | ||
paaudio.c | ||
rate_template.h | ||
sdlaudio.c | ||
sndioaudio.c | ||
spiceaudio.c | ||
trace-events | ||
trace.h | ||
wavaudio.c | ||
wavcapture.c |