]> git.sesse.net Git - ffmpeg/commit
ALSA demuxer: use av_gettime and a timefilter.
authorNicolas George <nicolas.george@normalesup.org>
Fri, 1 Jul 2011 13:26:40 +0000 (15:26 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 2 Jul 2011 08:43:38 +0000 (10:43 +0200)
commit5d35b279e21814b3b1499ae0b2e0e0dad7d7f782
tree1a4a710cd1c0221436692f4a2879cac4e019a0fc
parent3074f03a074de3aab79639d261cbd0ccc265b5b4
ALSA demuxer: use av_gettime and a timefilter.

The PTS for captured audio was measured using snd_pcm_htimestamp.

snd_pcm_htimestamp hangs when the input is a dsnoop plugin.

Furthermore, at some point, snd_pcm_htimestamp started returning monotonic
timestamps rather than wall clock timestamps, in most but not all
situations.
Monotonic timestamps are fine, but ffmpeg uses wall clock timestamps
everywhere else, and we have no API to inform the user which kind of
timestamps it is.

A separate snd_pcm_htimestamp is only slightly less accurate than
snd_pcm_htimestamp: the standard deviation for the difference between two
consecutive timestamps is (on my hardware):
- ~13 µs with snd_pcm_htimestamp;
- ~35 µs with av_gettime;
-  ~5 µs with av_gettime and a timefilter.
libavdevice/alsa-audio-common.c
libavdevice/alsa-audio-dec.c
libavdevice/alsa-audio.h
libavformat/Makefile