gst/: fixing lost sync, some more debugging

Original commit message from CVS:
* 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
This commit is contained in:
Stefan Kost 2005-09-08 22:42:11 +00:00
parent 0ba2f79cb5
commit 1aa698fefa
3 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,12 @@
2005-09-09 Stefan Kost <ensonic@users.sf.net>
* 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 <thaytan@mad.scientist.com>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),

View file

@ -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;

View file

@ -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;
}
}