From: Wim Taymans Date: Wed, 8 Jan 2014 13:52:04 +0000 (+0100) Subject: collectpads: take offset into account for expected segment position X-Git-Tag: 1.3.1~236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=888ab2396873c338f62c64a458799848d3b5da99;p=platform%2Fupstream%2Fgstreamer.git collectpads: take offset into account for expected segment position The firt valid segment position is start + offset. Also add some more debug and a FIXME --- diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index c82b0d4..32c905f 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -509,7 +509,8 @@ gst_collect_pads_clip_running_time (GstCollectPads * pads, if (G_LIKELY (GST_CLOCK_TIME_IS_VALID (time))) { time = gst_segment_to_running_time (&cdata->segment, GST_FORMAT_TIME, time); if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (time))) { - GST_DEBUG_OBJECT (cdata->pad, "clipping buffer on pad outside segment"); + GST_DEBUG_OBJECT (cdata->pad, "clipping buffer on pad outside segment %" + GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_PTS (buf))); gst_buffer_unref (buf); *outbuf = NULL; } else { @@ -1786,7 +1787,8 @@ gst_collect_pads_event_default (GstCollectPads * pads, GstCollectData * data, GST_COLLECT_PADS_STATE_SET (data, GST_COLLECT_PADS_STATE_NEW_SEGMENT); /* now we can use for e.g. running time */ - seg.position = gst_collect_pads_clip_time (pads, data, seg.start); + seg.position = + gst_collect_pads_clip_time (pads, data, seg.start + seg.offset); /* update again */ data->segment = seg; @@ -1809,6 +1811,7 @@ gst_collect_pads_event_default (GstCollectPads * pads, GstCollectData * data, GST_COLLECT_PADS_STREAM_LOCK (pads); gst_event_parse_gap (event, &start, &duration); + /* FIXME, handle reverse playback case */ if (GST_CLOCK_TIME_IS_VALID (duration)) start += duration; /* we do not expect another buffer until after gap,