diff --git a/ChangeLog b/ChangeLog index 07345d9952..caa797ce3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-09-09 Stefan Kost + + * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_base_audio_sink_render): + * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_commit): + * gst/volume/gstvolume.c: (gst_volume_class_init), + (volume_transform): + fixing lost sync, some more debugging + 2005-09-08 Jan Schmidt * sys/ximage/ximagesink.c: (gst_ximage_buffer_init), diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index b64e4f7622..28bc4c8d2f 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -368,8 +368,10 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf) /* roundoff errors in timestamp conversion */ diff = ABS ((gint64) render_offset - (gint64) sink->ringbuffer->next_sample); - GST_DEBUG ("render time %" GST_TIME_FORMAT ", render offset %llu, diff %lld", - GST_TIME_ARGS (render_time), render_offset, diff); + GST_DEBUG ("render time %" GST_TIME_FORMAT + ", render offset %llu, diff %lld, size %lu", GST_TIME_ARGS (render_time), + render_offset, diff, size); + GST_DEBUG ("ringgbuffer rate %lu", sink->ringbuffer->spec.rate); /* we tollerate a 10th of a second diff before we start resyncing. This * should be enough to compensate for various rounding errors in the timestamp @@ -379,8 +381,9 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf) render_offset = -1; /* FIXME, can we use the OFFSET field to detect a gap? */ } - + //GST_DEBUG ("ringgbuffer next (before) %llu", sink->ringbuffer->next_sample); gst_ring_buffer_commit (sink->ringbuffer, render_offset, data, size); + //GST_DEBUG ("ringgbuffer next (after) %llu", sink->ringbuffer->next_sample); return GST_FLOW_OK; diff --git a/gst-libs/gst/audio/gstringbuffer.c b/gst-libs/gst/audio/gstringbuffer.c index d569475b9b..029a4d1e9a 100644 --- a/gst-libs/gst/audio/gstringbuffer.c +++ b/gst-libs/gst/audio/gstringbuffer.c @@ -904,11 +904,11 @@ not_started: * @data: the data to commit * @len: the length of the data to commit * - * Commit @length samples pointed to by @data to the ringbuffer + * Commit @len samples pointed to by @data to the ringbuffer * @buf. The first sample should be written at position @sample in * the ringbuffer. * - * @len should not be a multiple of the segment size of the ringbuffer + * @len not needs to be a multiple of the segment size of the ringbuffer * although it is recommended. * * Returns: The number of samples written to the ringbuffer or -1 on @@ -935,6 +935,8 @@ gst_ring_buffer_commit (GstRingBuffer * buf, guint64 sample, guchar * data, if (sample != buf->next_sample) { GST_WARNING ("discontinuity found got %" G_GUINT64_FORMAT ", expected %" G_GUINT64_FORMAT, sample, buf->next_sample); + /* also sync here */ + sample = buf->next_sample; } }