diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2011-07-01 15:26:40 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2011-07-02 10:43:38 +0200 |
commit | 5d35b279e21814b3b1499ae0b2e0e0dad7d7f782 (patch) | |
tree | 1a4a710cd1c0221436692f4a2879cac4e019a0fc /libavdevice/alsa-audio.h | |
parent | 3074f03a074de3aab79639d261cbd0ccc265b5b4 (diff) | |
download | ffmpeg-5d35b279e21814b3b1499ae0b2e0e0dad7d7f782.tar.gz |
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.
Diffstat (limited to 'libavdevice/alsa-audio.h')
-rw-r--r-- | libavdevice/alsa-audio.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavdevice/alsa-audio.h b/libavdevice/alsa-audio.h index 9b1ecb1696..0226632479 100644 --- a/libavdevice/alsa-audio.h +++ b/libavdevice/alsa-audio.h @@ -33,6 +33,7 @@ #include <alsa/asoundlib.h> #include "config.h" #include "libavutil/log.h" +#include "libavformat/timefilter.h" #include "avdevice.h" /* XXX: we make the assumption that the soundcard accepts this format */ @@ -49,6 +50,7 @@ typedef struct { int period_size; ///< preferred size for reads and writes, in frames int sample_rate; ///< sample rate set by user int channels; ///< number of channels set by user + TimeFilter *timefilter; void (*reorder_func)(const void *, void *, int); void *reorder_buf; int reorder_buf_size; ///< in frames |