gint64 timestamp;
gint64 duration;
gint64 offset;
- GstSegment segment;
auparse = GST_AU_PARSE (parent);
if (ret != GST_FLOW_OK)
goto out;
- gst_segment_init (&segment, GST_FORMAT_TIME);
- gst_pad_push_event (auparse->srcpad, gst_event_new_segment (&segment));
+ if (auparse->need_segment) {
+ gst_pad_push_event (auparse->srcpad,
+ gst_event_new_segment (&auparse->segment));
+ auparse->need_segment = FALSE;
+ }
}
avail = gst_adapter_available (auparse->adapter);
{
gint64 start, stop, offset = 0;
GstSegment segment;
- GstEvent *new_event = NULL;
/* some debug output */
gst_event_copy_segment (event, &segment);
gst_segment_init (&segment, GST_FORMAT_TIME);
segment.start = segment.time = start;
segment.stop = stop;
- new_event = gst_event_new_segment (&segment);
- ret = gst_pad_push_event (auparse->srcpad, new_event);
+ gst_segment_copy_into (&segment, &auparse->segment);
+
+ if (!gst_pad_has_current_caps (auparse->srcpad)) {
+ auparse->need_segment = TRUE;
+ ret = TRUE;
+ } else {
+ auparse->need_segment = FALSE;
+ ret = gst_pad_push_event (auparse->srcpad,
+ gst_event_new_segment (&segment));
+ }
auparse->buffer_offset = offset;