From: Wim Taymans Date: Mon, 16 May 2011 14:57:48 +0000 (+0200) Subject: basesink: handle more formats X-Git-Tag: RELEASE-0.11.0~309 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=115c34badddaa294c5e8b00566efdd737210b5c1;p=platform%2Fupstream%2Fgstreamer.git basesink: handle more formats Don't hardcode GST_FORMAT_TIME in places, we can work with many formats. --- diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 249f05b..918982b 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1455,7 +1455,7 @@ gst_base_sink_configure_segment (GstBaseSink * basesink, GstPad * pad, /* the newsegment event is needed to bring the buffer timestamps to the * stream time and to drop samples outside of the playback segment. */ gst_event_parse_segment (event, segment); - GST_DEBUG_OBJECT (basesink, "configured NEWSEGMENT %" GST_SEGMENT_FORMAT, + GST_DEBUG_OBJECT (basesink, "configured SEGMENT %" GST_SEGMENT_FORMAT, segment); GST_OBJECT_UNLOCK (basesink); } @@ -1896,18 +1896,8 @@ again: /* collect segment and format for code clarity */ format = segment->format; - /* no timestamp clipping if we did not get a TIME segment format */ - if (G_UNLIKELY (format != GST_FORMAT_TIME)) { - cstart = start; - cstop = stop; - /* do running and stream time in TIME format */ - format = GST_FORMAT_TIME; - GST_LOG_OBJECT (basesink, "not time format, don't clip"); - goto do_times; - } - - /* clip, only when we know about time */ - if (G_UNLIKELY (!gst_segment_clip (segment, GST_FORMAT_TIME, + /* clip */ + if (G_UNLIKELY (!gst_segment_clip (segment, format, start, stop, &cstart, &cstop))) { if (step->valid) { GST_DEBUG_OBJECT (basesink, "step out of segment");