audiosrc: fix get_offset
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 17 Jun 2009 12:00:23 +0000 (14:00 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 17 Jun 2009 12:00:23 +0000 (14:00 +0200)
When we need to jump to the most recently captured sample, jump to where the
next sample will be written instead of to some old data.

Fixes #581460

gst-libs/gst/audio/gstbaseaudiosrc.c

index e64d0ef..078eadc 100644 (file)
@@ -726,7 +726,7 @@ gst_base_audio_src_get_offset (GstBaseAudioSrc * src)
   if (diff >= segtotal) {
     GST_DEBUG_OBJECT (src, "dropped, align to segment %d", segdone);
     /* sample would be dropped, position to next playable position */
-    sample = ((guint64) (segdone - segtotal + 1)) * sps;
+    sample = ((guint64) (segdone)) * sps;
   }
 
   return sample;