Commit 1aa698fe authored by Stefan Kost's avatar Stefan Kost
Browse files

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
parent 0ba2f79c
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),
......
......@@ -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;
......
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment