? gstbaseaudiosrc.c-bak ? gstbaseaudiosrc.h-bak ? patch Index: gstbaseaudiosrc.c =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.c,v retrieving revision 1.13 diff -u -3 -p -r1.13 gstbaseaudiosrc.c --- gstbaseaudiosrc.c 11 Oct 2005 18:32:01 -0000 1.13 +++ gstbaseaudiosrc.c 18 Oct 2005 17:33:58 -0000 @@ -294,6 +294,7 @@ gst_base_audio_src_event (GstBaseSrc * b case GST_EVENT_FLUSH_STOP: /* always resync on sample after a flush */ src->next_sample = -1; + src->next_timestamp = 0; gst_ring_buffer_clear_all (src->ringbuffer); break; default: @@ -334,6 +335,10 @@ gst_base_audio_src_create (GstPushSrc * src->next_sample = sample + samples; + GST_BUFFER_DURATION(buf) = src->ringbuffer->samples_per_seg * GST_SECOND / src->ringbuffer->spec.rate; + GST_BUFFER_TIMESTAMP(buf) = src->next_timestamp; + src->next_timestamp += GST_BUFFER_DURATION(buf); + gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc))); *outbuf = buf; @@ -394,6 +399,7 @@ gst_base_audio_src_change_state (GstElem if (!gst_ring_buffer_open_device (src->ringbuffer)) return GST_STATE_CHANGE_FAILURE; src->next_sample = 0; + src->next_timestamp = 0; break; case GST_STATE_CHANGE_READY_TO_PAUSED: break; @@ -412,6 +418,7 @@ gst_base_audio_src_change_state (GstElem case GST_STATE_CHANGE_PAUSED_TO_READY: gst_ring_buffer_release (src->ringbuffer); src->next_sample = 0; + src->next_timestamp = 0; break; case GST_STATE_CHANGE_READY_TO_NULL: gst_ring_buffer_close_device (src->ringbuffer); Index: gstbaseaudiosrc.h =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.h,v retrieving revision 1.4 diff -u -3 -p -r1.4 gstbaseaudiosrc.h --- gstbaseaudiosrc.h 6 Oct 2005 15:15:04 -0000 1.4 +++ gstbaseaudiosrc.h 18 Oct 2005 17:33:58 -0000 @@ -60,6 +60,9 @@ struct _GstBaseAudioSrc { /* the next sample to write */ guint64 next_sample; + /* timestamp of next sample */ + guint64 next_timestamp; + /* clock */ GstClock *clock;