libs/gst/base/gstadapter.c: Small code cleanup.

Original commit message from CVS:
* libs/gst/base/gstadapter.c: (gst_adapter_available_fast):
Small code cleanup.
* libs/gst/base/gstbasesink.c: (gst_base_sink_query_latency),
(gst_base_sink_set_flushing):
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek):
Fix some comments.
This commit is contained in:
Wim Taymans 2008-05-07 09:47:27 +00:00
parent ae658f35dd
commit 640d16a2bc
4 changed files with 22 additions and 4 deletions

View file

@ -1,3 +1,13 @@
2008-05-07 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstadapter.c: (gst_adapter_available_fast):
Small code cleanup.
* libs/gst/base/gstbasesink.c: (gst_base_sink_query_latency),
(gst_base_sink_set_flushing):
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek):
Fix some comments.
2008-05-07 Wim Taymans <wim.taymans@collabora.co.uk>
* plugins/elements/gstfakesrc.c: (gst_fake_src_class_init),

View file

@ -594,6 +594,9 @@ gst_adapter_available (GstAdapter * adapter)
guint
gst_adapter_available_fast (GstAdapter * adapter)
{
GstBuffer *first;
guint size;
g_return_val_if_fail (GST_IS_ADAPTER (adapter), 0);
/* no buffers, we have no data */
@ -604,9 +607,13 @@ gst_adapter_available_fast (GstAdapter * adapter)
if (adapter->assembled_len)
return adapter->assembled_len;
/* take the first buffer and its size */
first = GST_BUFFER_CAST (adapter->buflist->data);
size = GST_BUFFER_SIZE (first);
/* we cannot have skipped more than the first buffer */
g_assert (GST_BUFFER_SIZE (adapter->buflist->data) > adapter->skip);
g_assert (size > adapter->skip);
/* we can quickly get the data of the first buffer */
return GST_BUFFER_SIZE (adapter->buflist->data) - adapter->skip;
return size - adapter->skip;
}

View file

@ -2699,7 +2699,8 @@ gst_base_sink_set_flushing (GstBaseSink * basesink, GstPad * pad,
gst_clock_id_unschedule (basesink->clock_id);
}
/* flush out the data thread if it's locked in finish_preroll */
/* flush out the data thread if it's locked in finish_preroll, this will
* also flush out the EOS state */
GST_DEBUG_OBJECT (basesink,
"flushing out data thread, need preroll to TRUE");
gst_base_sink_preroll_queue_flush (basesink, pad);

View file

@ -1248,7 +1248,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
src->segment.rate, src->segment.applied_rate, src->segment.format,
src->segment.last_stop, stop, src->segment.time);
} else {
/* reverse, we send data from stop to last_stop */
/* reverse, we send data from last_stop to start */
src->priv->start_segment =
gst_event_new_new_segment_full (FALSE,
src->segment.rate, src->segment.applied_rate, src->segment.format,