videoaggregator: fix buffer skipping with pad offsets

The ->skip_buffer implementation in videoaggregator replicates
the behaviour of the aggregate method to determine whether a
buffer can be skipped
(https://bugzilla.gnome.org/show_bug.cgi?id=781928).

This fixes a typo that made it so the start time of the buffer
was calculated against the output segment, not the segment of
the relevant sinkpad, which caused buffers to be skipped when
for example a sinkpad had received a segment which base had
been modified by a pad offset somewhere along the way.

This simply makes the calculation of the buffer start time
identical to the calculation in aggregate()
This commit is contained in:
Mathieu Duponchelle 2019-03-07 18:55:33 +01:00 committed by Sebastian Dröge
parent 6a37bf9bb9
commit a35d500eae

View file

@ -163,7 +163,7 @@ gst_video_aggregator_pad_skip_buffer (GstAggregatorPad * aggpad,
if (agg_segment->position != GST_CLOCK_TIME_NONE
&& GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE) {
GstClockTime start_time =
gst_segment_to_running_time (agg_segment, GST_FORMAT_TIME,
gst_segment_to_running_time (&aggpad->segment, GST_FORMAT_TIME,
GST_BUFFER_PTS (buffer));
GstClockTime end_time = start_time + GST_BUFFER_DURATION (buffer);
GstClockTime output_start_running_time =