baseparse: use correct offset when adding index entry

... bearing in mind that BUFFER_OFFSET is media specific and may not
reflect the basic offset after having been parsed.
This commit is contained in:
Mark Nauwelaerts 2010-11-17 16:23:42 +01:00
parent 9b6439a36c
commit 68dca2e704

View file

@ -1429,6 +1429,12 @@ gst_base_parse_handle_and_push_buffer (GstBaseParse * parse,
parse->priv->next_ts = GST_CLOCK_TIME_NONE; parse->priv->next_ts = GST_CLOCK_TIME_NONE;
} }
if (parse->priv->upstream_seekable && parse->priv->exact_position &&
GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
gst_base_parse_add_index_entry (parse, offset,
GST_BUFFER_TIMESTAMP (buffer),
!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT), FALSE);
/* First buffers are dropped, this means that the subclass needs more /* First buffers are dropped, this means that the subclass needs more
* frames to decide on the format and queues them internally */ * frames to decide on the format and queues them internally */
/* convert internal flow to OK and mark discont for the next buffer. */ /* convert internal flow to OK and mark discont for the next buffer. */
@ -1589,12 +1595,6 @@ gst_base_parse_push_buffer (GstBaseParse * parse, GstBuffer * buffer)
parse->priv->pending_events = NULL; parse->priv->pending_events = NULL;
} }
if (parse->priv->upstream_seekable && parse->priv->exact_position &&
GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
gst_base_parse_add_index_entry (parse, GST_BUFFER_OFFSET (buffer),
GST_BUFFER_TIMESTAMP (buffer),
!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT), FALSE);
if (klass->pre_push_buffer) if (klass->pre_push_buffer)
ret = klass->pre_push_buffer (parse, buffer); ret = klass->pre_push_buffer (parse, buffer);
else else