16 Feb
2023
16 Feb
'23
3:24 p.m.
On 16. 02. 23 14:58, Alan Young wrote:
Introduce snd_pcm_lib_frames_to_timespec64() to replace the calculation
audio_nsecs = div_u64(audio_frames * 1000000000LL, runtime->rate);
which overflows after a playback duration of 4.8 days @ 44100 HZ or 0.56 days @ 384000 Hz.
The implementation of snd_pcm_lib_frames_to_timespec64() extends these limits, to 1.5 million years (@ 384000 Hz), or the 68 year limit of struct timespec on 32-bit systems.
Fixes: 3179f6200188 ("ALSA: core: add .get_time_info") Fixes: 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps") Signed-off-by: consult.awy@gmail.com
Suggested-by: Jaroslav Kysela perex@perex.cz Reviewed-by: Jaroslav Kysela perex@perex.cz
Jaroslav
--
Jaroslav Kysela perex@perex.cz
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.