From: Olivier CrĂȘte Date: Thu, 30 Jul 2015 00:06:11 +0000 (-0400) Subject: aggregator: Ignore the "first" mode if the segment not a time segment X-Git-Tag: 1.19.3~507^2~8221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50b7d1d5772acef2aa93fe78e53933e08faa016a;p=platform%2Fupstream%2Fgstreamer.git aggregator: Ignore the "first" mode if the segment not a time segment --- diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c index c6c6a2ca4f..2be13e4203 100644 --- a/gst-libs/gst/base/gstaggregator.c +++ b/gst-libs/gst/base/gstaggregator.c @@ -1953,12 +1953,20 @@ gst_aggregator_pad_chain (GstPad * pad, GstObject * object, GstBuffer * buffer) start_time = 0; break; case GST_AGGREGATOR_START_TIME_SELECTION_FIRST: - start_time = GST_BUFFER_PTS (actual_buf); - if (start_time != -1) { - start_time = MAX (start_time, aggpad->segment.start); - start_time = - gst_segment_to_running_time (&aggpad->segment, GST_FORMAT_TIME, - start_time); + if (aggpad->segment.format == GST_FORMAT_TIME) { + start_time = GST_BUFFER_PTS (actual_buf); + if (start_time != -1) { + start_time = MAX (start_time, aggpad->segment.start); + start_time = + gst_segment_to_running_time (&aggpad->segment, GST_FORMAT_TIME, + start_time); + } + } else { + start_time = 0; + GST_WARNING_OBJECT (aggpad, + "Ignoring request of selecting the first start time " + "as the segment is a %s segment instead of a time segment", + gst_format_get_name (aggpad->segment.format)); } break; case GST_AGGREGATOR_START_TIME_SELECTION_SET: