gst/: Small cleanups in docs and code.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 15 Sep 2006 08:43:44 +0000 (08:43 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 15 Sep 2006 08:43:44 +0000 (08:43 +0000)
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.

ChangeLog
gst/gstobject.c
gst/gstpipeline.c
gst/gstsegment.c
tests/check/gst/gstsegment.c

index 66b2a4b..7c4571f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 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>
+
        * docs/design/part-buffering.txt:
        * docs/gst/gstreamer-sections.txt:
        * gst/gstmessage.c: (gst_message_new_buffering),
index 2c636fa..9611c71 100644 (file)
@@ -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;
   }
index 75888bd..b2e8111 100644 (file)
@@ -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);
     }
   }
index 4d25443..2f33afd 100644 (file)
@@ -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) {
index 21c8ddb..c0a728e 100644 (file)
@@ -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);