Commit bb634398 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/: Small cleanups in docs and code.

Original commit message from CVS:
* 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.
parent bc14daab
2006-09-15 Wim Taymans <wim@fluendo.com>
* 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 <wim@fluendo.com> 2006-09-15 Wim Taymans <wim@fluendo.com>
   
* docs/design/part-buffering.txt: * docs/design/part-buffering.txt:
......
...@@ -810,6 +810,8 @@ gst_object_set_parent (GstObject * object, GstObject * parent) ...@@ -810,6 +810,8 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
/* ERROR handling */ /* ERROR handling */
had_parent: had_parent:
{ {
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object,
"set parent failed, object already had a parent");
GST_OBJECT_UNLOCK (object); GST_OBJECT_UNLOCK (object);
return FALSE; return FALSE;
} }
......
...@@ -341,12 +341,12 @@ do_pipeline_seek (GstElement * element, GstEvent * event) ...@@ -341,12 +341,12 @@ do_pipeline_seek (GstElement * element, GstEvent * event)
/* need to call _get_state() since a bin state is only updated /* need to call _get_state() since a bin state is only updated
* with this call. */ * with this call. */
gst_element_get_state (element, &state, NULL, 0); gst_element_get_state (element, &state, NULL, 0);
was_playing = state == GST_STATE_PLAYING; was_playing = (state == GST_STATE_PLAYING);
if (was_playing) { if (was_playing) {
/* and PAUSE when the pipeline was PLAYING, we don't need /* and PAUSE when the pipeline was PLAYING, we don't need
* to wait for the state change to complete since we are going * 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); gst_element_set_state (element, GST_STATE_PAUSED);
} }
} }
......
...@@ -630,7 +630,7 @@ gst_segment_clip (GstSegment * segment, GstFormat format, gint64 start, ...@@ -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, /* if a stop position is given and is before the segment start,
* we're outside of the segment */ * 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; return FALSE;
if (clip_start) { if (clip_start) {
......
...@@ -70,6 +70,13 @@ GST_START_TEST (segment_seek_nosize) ...@@ -70,6 +70,13 @@ GST_START_TEST (segment_seek_nosize)
fail_unless (cstart == 100); fail_unless (cstart == 100);
fail_unless (cstop == 150); 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 */ /* completely inside */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES, res = gst_segment_clip (&segment, GST_FORMAT_BYTES,
150, 200, &cstart, &cstop); 150, 200, &cstart, &cstop);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment