gst/base/gstbasesrc.c: Send discont event from the loop function, as pads aren't...
authorJan Schmidt <thaytan@mad.scientist.com>
Mon, 18 Jul 2005 17:12:36 +0000 (17:12 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Mon, 18 Jul 2005 17:12:36 +0000 (17:12 +0000)
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_loop),
(gst_base_src_activate_push):
Send discont event from the loop function, as pads
aren't activated yet in the activate_push handler.

* gst/gstbin.c: (bin_bus_handler):
Don't leak element name.

ChangeLog
common
gst/base/gstbasesrc.c
gst/gstbin.c
libs/gst/base/gstbasesrc.c

index b72fb14..b52717d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-07-19  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * gst/base/gstbasesrc.c: (gst_base_src_loop),
+       (gst_base_src_activate_push):
+         Send discont event from the loop function, as pads
+         aren't activated yet in the activate_push handler.
+
+       * gst/gstbin.c: (bin_bus_handler):
+         Don't leak element name.
+
 2005-07-18  Andy Wingo  <wingo@pobox.com>
 
        * configure.ac: Use AS_LIBTOOL_TAGS.
diff --git a/common b/common
index eaed65b..6f9b691 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit eaed65b6bf08986131bfa3bcb15e88d6e2106a51
+Subproject commit 6f9b691adc2a0300598311671dd7c4d9d2035afa
index f866bf0..8502f89 100644 (file)
@@ -656,6 +656,12 @@ gst_base_src_loop (GstPad * pad)
 
   src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
 
+  if (src->offset == 0) {
+    /* now send discont */
+    if (!gst_base_src_send_discont (src))
+      goto eos;
+  }
+
   ret = gst_base_src_get_range (pad, src->offset, src->blocksize, &buf);
   if (ret != GST_FLOW_OK)
     goto eos;
@@ -956,9 +962,6 @@ gst_base_src_activate_push (GstPad * pad, gboolean active)
     if (!gst_base_src_start (basesrc))
       goto error_start;
 
-    /* now send discont */
-    gst_base_src_send_discont (basesrc);
-
     return gst_pad_start_task (pad, (GstTaskFunction) gst_base_src_loop, pad);
   } else {
     return gst_base_src_deactivate (basesrc, pad);
index a233941..26a00a3 100644 (file)
@@ -1405,9 +1405,11 @@ bin_bus_handler (GstBus * bus, GstMessage * message, GstBin * bin)
   /* we don't want messages from the streaming thread while we're doing the
    * state change. We do want them from the state change functions. */
   switch (GST_MESSAGE_TYPE (message)) {
-    case GST_MESSAGE_EOS:
-      GST_DEBUG_OBJECT (bin, "got EOS message from %s",
-          gst_object_get_name (GST_MESSAGE_SRC (message)));
+    case GST_MESSAGE_EOS:{
+      gchar *name = gst_object_get_name (GST_MESSAGE_SRC (message));
+
+      GST_DEBUG_OBJECT (bin, "got EOS message from %s", name);
+      g_free (name);
 
       GST_LOCK (bin->child_bus);
       bin->eosed = g_list_prepend (bin->eosed, GST_MESSAGE_SRC (message));
@@ -1422,6 +1424,7 @@ bin_bus_handler (GstBus * bus, GstMessage * message, GstBin * bin)
       /* we drop all EOS messages */
       gst_message_unref (message);
       break;
+    }
     default:
       /* Send all other messages upward */
       GST_DEBUG_OBJECT (bin, "posting message upward");
index f866bf0..8502f89 100644 (file)
@@ -656,6 +656,12 @@ gst_base_src_loop (GstPad * pad)
 
   src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
 
+  if (src->offset == 0) {
+    /* now send discont */
+    if (!gst_base_src_send_discont (src))
+      goto eos;
+  }
+
   ret = gst_base_src_get_range (pad, src->offset, src->blocksize, &buf);
   if (ret != GST_FLOW_OK)
     goto eos;
@@ -956,9 +962,6 @@ gst_base_src_activate_push (GstPad * pad, gboolean active)
     if (!gst_base_src_start (basesrc))
       goto error_start;
 
-    /* now send discont */
-    gst_base_src_send_discont (basesrc);
-
     return gst_pad_start_task (pad, (GstTaskFunction) gst_base_src_loop, pad);
   } else {
     return gst_base_src_deactivate (basesrc, pad);