subparse: fix parsing by not misusing non time segments

A simple filesrc ! subparse ! fakesink type pipeline now works again.
This commit is contained in:
Vincent Penquerc'h 2012-01-24 17:42:51 +00:00
parent 15b7375c44
commit 17ea0308cf

View file

@ -1582,6 +1582,9 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
} }
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
const GstSegment *s;
gst_event_parse_segment (event, &s);
if (s->format == GST_FORMAT_TIME)
gst_event_copy_segment (event, &self->segment); gst_event_copy_segment (event, &self->segment);
GST_DEBUG_OBJECT (self, "newsegment (%s)", GST_DEBUG_OBJECT (self, "newsegment (%s)",
gst_format_get_name (self->segment.format)); gst_format_get_name (self->segment.format));