diff --git a/ChangeLog b/ChangeLog index b3b0f39517..3c91f1c4fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-09 Sebastian Dröge + + * plugins/elements/gstidentity.c: (gst_identity_event), + (gst_identity_start): + Fix imperfect timestamp/offset checks when we get another NEWSEGMENT + event after processing some data. Fixes bug #526042. + 2008-04-08 Wim Taymans * docs/gst/gstreamer-sections.txt: diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index d10f42b862..096f944e39 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -341,6 +341,13 @@ gst_identity_event (GstBaseTransform * trans, GstEvent * event) } } + /* Reset previous timestamp, duration and offsets on NEWSEGMENT + * to prevent false warnings when checking for perfect streams */ + if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT) { + identity->prev_timestamp = identity->prev_duration = GST_CLOCK_TIME_NONE; + identity->prev_offset = identity->prev_offset_end = GST_BUFFER_OFFSET_NONE; + } + GST_BASE_TRANSFORM_CLASS (parent_class)->event (trans, event); if (identity->single_segment @@ -762,8 +769,8 @@ gst_identity_start (GstBaseTransform * trans) identity->offset = 0; identity->prev_timestamp = GST_CLOCK_TIME_NONE; identity->prev_duration = GST_CLOCK_TIME_NONE; - identity->prev_offset_end = -1; - identity->prev_offset = -1; + identity->prev_offset_end = GST_BUFFER_OFFSET_NONE; + identity->prev_offset = GST_BUFFER_OFFSET_NONE; return TRUE; }