28 Sep
2012
28 Sep
'12
11:33 a.m.
Pierre-Louis Bossart wrote:
@@ -506,8 +512,27 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
if (!(runtime->hw.info & SNDRV_PCM_INFO_HAS_WALL_CLOCK)) {
/*
* no wall clock available, provide audio timestamp
* derived from pointer position+delay
*/
u64 audio_frames, audio_nsecs;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
audio_frames = runtime->status->hw_ptr
- runtime->delay;
else
audio_frames = runtime->status->hw_ptr
+ runtime->delay;
audio_nsecs = audio_frames * 1000000000LL /
runtime->rate;
This looks like a 64-bit division.
And what happens if audio_frames becomes negative?
Regards, Clemens