From: Jan Schmidt Date: Mon, 18 Jul 2005 17:12:36 +0000 (+0000) Subject: gst/base/gstbasesrc.c: Send discont event from the loop function, as pads aren't... X-Git-Tag: RELEASE-0_9_2~212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=518e590f8b0ba93979718a9269395b4906b3193c;p=platform%2Fupstream%2Fgstreamer.git gst/base/gstbasesrc.c: Send discont event from the loop function, as pads aren't activated yet in the activate_push h... 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. --- diff --git a/ChangeLog b/ChangeLog index b72fb14..b52717d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-07-19 Jan Schmidt + + * 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 * configure.ac: Use AS_LIBTOOL_TAGS. diff --git a/common b/common index eaed65b..6f9b691 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit eaed65b6bf08986131bfa3bcb15e88d6e2106a51 +Subproject commit 6f9b691adc2a0300598311671dd7c4d9d2035afa diff --git a/gst/base/gstbasesrc.c b/gst/base/gstbasesrc.c index f866bf0..8502f89 100644 --- a/gst/base/gstbasesrc.c +++ b/gst/base/gstbasesrc.c @@ -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); diff --git a/gst/gstbin.c b/gst/gstbin.c index a233941..26a00a3 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -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"); diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index f866bf0..8502f89 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -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);