diff --git a/ChangeLog b/ChangeLog index 66b2a4bddb..7c4571f4de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-09-15 Wim Taymans + + * gst/gstobject.c: (gst_object_set_parent): + * gst/gstpipeline.c: (do_pipeline_seek): + Small cleanups in docs and code. + + * gst/gstsegment.c: (gst_segment_clip): + * tests/check/gst/gstsegment.c: (GST_START_TEST): + if stop == start and start is in the segment, no clipping should be + done. Also add a test for this. + 2006-09-15 Wim Taymans * docs/design/part-buffering.txt: diff --git a/gst/gstobject.c b/gst/gstobject.c index 2c636fafae..9611c71218 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -810,6 +810,8 @@ gst_object_set_parent (GstObject * object, GstObject * parent) /* ERROR handling */ had_parent: { + GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, + "set parent failed, object already had a parent"); GST_OBJECT_UNLOCK (object); return FALSE; } diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 75888bd348..b2e8111293 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -341,12 +341,12 @@ do_pipeline_seek (GstElement * element, GstEvent * event) /* need to call _get_state() since a bin state is only updated * with this call. */ gst_element_get_state (element, &state, NULL, 0); - was_playing = state == GST_STATE_PLAYING; + was_playing = (state == GST_STATE_PLAYING); if (was_playing) { /* and PAUSE when the pipeline was PLAYING, we don't need * to wait for the state change to complete since we are going - * to flush out any preroll sample anyway */ + * to flush out any preroll sample anyway. */ gst_element_set_state (element, GST_STATE_PAUSED); } } diff --git a/gst/gstsegment.c b/gst/gstsegment.c index 4d25443401..2f33afda2b 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -630,7 +630,7 @@ gst_segment_clip (GstSegment * segment, GstFormat format, gint64 start, /* if a stop position is given and is before the segment start, * we're outside of the segment */ - if (G_UNLIKELY (stop != -1 && stop <= segment->start)) + if (G_UNLIKELY (stop != -1 && stop != start && stop <= segment->start)) return FALSE; if (clip_start) { diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c index 21c8ddbdd2..c0a728ed92 100644 --- a/tests/check/gst/gstsegment.c +++ b/tests/check/gst/gstsegment.c @@ -70,6 +70,13 @@ GST_START_TEST (segment_seek_nosize) fail_unless (cstart == 100); fail_unless (cstop == 150); + /* special case, 0 duration */ + res = gst_segment_clip (&segment, GST_FORMAT_BYTES, + 100, 100, &cstart, &cstop); + fail_unless (res == TRUE); + fail_unless (cstart == 100); + fail_unless (cstop == 100); + /* completely inside */ res = gst_segment_clip (&segment, GST_FORMAT_BYTES, 150, 200, &cstart, &cstop);