summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-08-02 10:11:14 -0300
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-12-17 11:47:34 +0100
commit929edc25728a45d889ca46f38ce62d421c072122 (patch)
treeaefe6fd960ded9bfd0dab5b227dfaceee4cff759 /gst-libs
parent53072a43261c8f45f6b572b7463f83953a4549d6 (diff)
audiobasesrc: Always resync the ringbuffer on the first buffer
In SKEW mode, use next_sample == -1 to check for the first sample when starting to read samples so it resyncs the ringbuffer and timestamps are ok. Suggestion from Teemu Katajisto <teemu.katajisto@digia.com> https://bugzilla.gnome.org/show_bug.cgi?id=648359
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/audio/gstaudiobasesrc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c
index f594f51b2..99d582767 100644
--- a/gst-libs/gst/audio/gstaudiobasesrc.c
+++ b/gst-libs/gst/audio/gstaudiobasesrc.c
@@ -766,6 +766,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
GstClockTime rb_timestamp = GST_CLOCK_TIME_NONE;
GstClock *clock;
gboolean first;
+ gboolean first_sample = src->next_sample == -1;
ringbuffer = src->ringbuffer;
spec = &ringbuffer->spec;
@@ -938,7 +939,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
* the first time we are ran.
*/
if ((segment_skew >= ringbuffer->spec.segtotal) ||
- (last_read_segment == 0)) {
+ (last_read_segment == 0) || first_sample) {
gint new_read_segment;
gint segment_diff;
guint64 new_sample;