GstPad *active_sinkpad;
GstPad *prev_active_sinkpad;
GstSelectorPad *selpad;
- GstClockTime end_time, duration;
+ GstClockTime start_time, end_time, duration;
GstSegment *seg;
GstEvent *close_event = NULL, *start_event = NULL;
GstCaps *caps;
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
/* update the segment on the srcpad */
- end_time = GST_BUFFER_TIMESTAMP (buf);
- if (GST_CLOCK_TIME_IS_VALID (end_time)) {
+ start_time = GST_BUFFER_TIMESTAMP (buf);
+ if (GST_CLOCK_TIME_IS_VALID (start_time)) {
GST_DEBUG_OBJECT (pad, "received start time %" GST_TIME_FORMAT,
- GST_TIME_ARGS (end_time));
+ GST_TIME_ARGS (start_time));
duration = GST_BUFFER_DURATION (buf);
if (GST_CLOCK_TIME_IS_VALID (duration))
end_time += duration;
GST_TIME_ARGS (end_time));
GST_OBJECT_LOCK (pad);
- gst_segment_set_last_stop (seg, seg->format, end_time);
+ gst_segment_set_last_stop (seg, seg->format, start_time);
GST_OBJECT_UNLOCK (pad);
}