From a35d500eaeef06b2eb438f17c9f20702ef280b11 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 7 Mar 2019 18:55:33 +0100 Subject: [PATCH] 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() --- gst-libs/gst/video/gstvideoaggregator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index ea37c71..93d263d 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -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 = -- 2.7.4