baseparse: remove checks for buffer==NULL

Accordifn to docs for GstPadChainFunction buffer cannot be NULL. If we would
leave the check, we would also need more such check below.
This commit is contained in:
Stefan Kost 2009-02-26 11:02:06 +02:00
parent 3ee87fa8f2
commit 68cb1a84de
3 changed files with 15 additions and 27 deletions

View file

@ -838,7 +838,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_PARSE_GET_CLASS (parse);
if (parse->pending_segment) {
if (G_UNLIKELY (parse->pending_segment)) {
GST_DEBUG_OBJECT (parse, "chain pushing a pending segment");
gst_pad_push_event (parse->srcpad, parse->pending_segment);
parse->pending_segment = NULL;
@ -854,7 +854,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
gst_adapter_clear (parse->adapter);
}
if (parse->priv->pending_events) {
if (G_UNLIKELY (parse->priv->pending_events)) {
GList *l;
for (l = parse->priv->pending_events; l != NULL; l = l->next) {
@ -864,13 +864,9 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
parse->priv->pending_events = NULL;
}
if (buffer) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->adapter, buffer);
}
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->adapter, buffer);
/* Parse and push as many frames as possible */
/* Stop either when adapter is empty or we are flushing */

View file

@ -838,7 +838,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_PARSE_GET_CLASS (parse);
if (parse->pending_segment) {
if (G_UNLIKELY (parse->pending_segment)) {
GST_DEBUG_OBJECT (parse, "chain pushing a pending segment");
gst_pad_push_event (parse->srcpad, parse->pending_segment);
parse->pending_segment = NULL;
@ -854,7 +854,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
gst_adapter_clear (parse->adapter);
}
if (parse->priv->pending_events) {
if (G_UNLIKELY (parse->priv->pending_events)) {
GList *l;
for (l = parse->priv->pending_events; l != NULL; l = l->next) {
@ -864,13 +864,9 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
parse->priv->pending_events = NULL;
}
if (buffer) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->adapter, buffer);
}
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->adapter, buffer);
/* Parse and push as many frames as possible */
/* Stop either when adapter is empty or we are flushing */

View file

@ -982,20 +982,16 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer)
/* Make sure that adapter doesn't have any old data after
newsegment has been received and update our offset */
if (parse->pending_segment) {
gst_adapter_clear (parse->priv->adapter);
if (G_UNLIKELY (parse->pending_segment)) {
parse->priv->offset = parse->priv->pending_offset;
gst_adapter_clear (parse->priv->adapter);
}
gst_base_parse_update_upstream_durations (parse);
if (buffer) {
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->priv->adapter, buffer);
}
GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld",
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
gst_adapter_push (parse->priv->adapter, buffer);
/* Parse and push as many frames as possible */
/* Stop either when adapter is empty or we are flushing */