Re: [PATCH 2/2] ALSA: Change calculation of audio time from frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx

Suggested-by: Jaroslav Kysela <perex@xxxxxxxx>
Reviewed-by: Jaroslav Kysela <perex@xxxxxxxx>

					Jaroslav

--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux