gstreamer/gst-libs/gst/audio
Felipe Contreras 0a111bf26e baseaudiosink: delay the resyncing of timestamp vs ringbuffertime
A common problem for audio-playback is that the timestamps might not
be completely linear. This is specially common when doing streaming over
a network, where you can have jittery and/or bursty packettransmission,
which again will often be reflected on the buffertimestamps.

Now, the current implementation have a threshold that says how far the
buffertimestamp is allowed o drift from the ideal aligned time in the
ringbuffer. This was an instant reaction, and ment that if one buffer
arrived with a timestamp that would breach the drift-tolerance, a resync
would take place, and the result would be an audible gap for the
listener.

The annoying thing would be that in the case of a "timestamp-outlier",
you would first resync one way, say +100ms, and then, if the next
timestamp was "back on track", you would end up resyncing the other way
(-100ms) So in fact, when you had only one buffer with slightly off
timestamping, you would end up with *two* audible gaps. This is the
problem this patch addresses.

The way to "fix" this problem with the previous implementation, would
have been to increase the "drift-tolerance" to a value that was greater
than the largest timestamp-outlier one would normally expect.  The big
problem with this approach, however, is that it will allow normal
operations with a huge offset timestamp vs running-time, which is
detrimental to lip-sync. If the drift-tolerance is set to 200ms, it
basically means that lip-sync can easily end up being off by that much.

This patch will basically start a timer when the first breach of
drift-tolerance is detected. If any following timestamp for the next n
nanoseconds gets "back on track" within the threshold, it has basically
eliminated the effect of an outlier, and the timer is stopped.  If,
however, all timestamps within this time-limit are breaching the
threshold, we are probably facing a more permanent offset in the
timestamps, and a resync is allowed to happen.

So basically this patch offers something as rare as both higher
accuracy, it terms of allowing smaller drift-tolerances, as well as much
smoother, less glitchy playback!

Commit message and improvments by Havard Graff.

Fixes bug #640859.
2011-11-07 11:33:32 +01:00
..
.gitignore audio: move testchannels example to 'tests/examples' dir 2011-05-27 15:09:25 +03:00
audio.c audio: update internal silent sample defines as well to match 0.11 2011-09-06 15:46:45 +01:00
audio.def add more plugins to the build add some definitions needed by plugins fixes for build problems 2004-07-26 22:09:59 +00:00
audio.h audio: some more accessor macros for GstAudioInfo 2011-09-22 15:45:05 +02:00
audio.vcproj more working plugins 2004-07-27 21:41:30 +00:00
audiofilter.vcproj more working plugins 2004-07-27 21:41:30 +00:00
gstaudioclock.c audio: make public get_type() functions thread-safe 2010-10-08 11:34:58 +01:00
gstaudioclock.h docs: fixup audio-library docs 2011-05-23 15:08:24 +03:00
gstaudiodecoder.c audiodecoder: having gather queue contents implies some draining is in order 2011-10-19 16:51:09 +02:00
gstaudiodecoder.h audiodecoder: Fix thread safety issues if both pads have different streaming threads 2011-09-26 16:22:00 +02:00
gstaudioencoder.c audioencoder: only resync to upstream upon discont in perfect ts mode 2011-10-08 20:20:10 +02:00
gstaudioencoder.h audioencoder: Add support for requesting a minimum and maximum number of samples per frame 2011-09-26 15:59:22 +02:00
gstaudiofilter.c docs: handle warnings emitted by gtk-doc 2011-08-20 19:16:42 +02:00
gstaudiofilter.h docs: fixup audio-library docs 2011-05-23 15:08:24 +03:00
gstaudioiec61937.c docs: fix docs for new api 2011-05-23 14:56:17 +03:00
gstaudioiec61937.h docs: fix docs for new api 2011-05-23 14:56:17 +03:00
gstaudiosink.c audiosink: avoid deadlocking audioringbuffer thread 2011-10-28 14:07:40 +02:00
gstaudiosink.h Add a FIXME 0.11. Make the log message a bit more detailed and add comments. 2009-02-02 18:05:42 +02:00
gstaudiosrc.c audiosrc: add gratuitious FIXME for use of generic G_TYPE_POINTER type 2010-01-27 00:42:37 +00:00
gstaudiosrc.h docs: fixup audio-library docs 2011-05-23 15:08:24 +03:00
gstbaseaudiosink.c baseaudiosink: delay the resyncing of timestamp vs ringbuffertime 2011-11-07 11:33:32 +01:00
gstbaseaudiosink.h baseaudiosink: split drift-tolerance into alignment-threshold 2011-11-07 11:10:05 +01:00
gstbaseaudiosrc.c baseaudiosrc: don't try to fixate "width" field for alaw/mulaw 2011-09-10 18:30:55 +01:00
gstbaseaudiosrc.h gst-libs/gst/audio/: Complete Sebastien's commit from the 13th by exporting the _slave_method_get_type() methods. 2008-12-30 17:55:07 +00:00
gstringbuffer.c baseaudiosink: Use g_str_equal() instead of strncmp() 2011-05-14 18:53:12 +05:30
gstringbuffer.h docs: add missing documentation for various pieces 2011-05-23 23:56:09 +03:00
Makefile.am audio: rename GstBaseAudioDecoder/Encoder to GstAudioDecoder/Encoder 2011-09-05 23:28:13 +01:00
mixerutils.c gst-libs/gst/audio/mixerutils.c: Make order in which elements are tried more determinable. 2006-02-20 16:21:14 +00:00
mixerutils.h gst-libs/gst/audio/mixerutils.h: Add G_BEGIN_DECLS and G_END_DECLS guards so these helpers can be used when compiling... 2007-01-12 12:47:29 +00:00
multichannel.c audio: add GstAudioFormat, GstAudioFormatInfo and GstAudioInfo 2011-08-27 14:47:01 +01:00
multichannel.h audio: add GstAudioFormat, GstAudioFormatInfo and GstAudioInfo 2011-08-27 14:47:01 +01:00
TODO gst-libs/gst/audio/TODO: Update TODO 2006-02-17 10:15:52 +00:00