diff --git a/ChangeLog b/ChangeLog index b964e74dcd..8c297d9b5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-22 Stefan Kost + + * gst/debug/gsttaginject.c: + * gst/debug/gsttaginject.h: + Sent tags in _transform_ip() instead of _start(). Fixes #543404 + partially. + 2008-07-19 Jan Schmidt * configure.ac: diff --git a/common b/common index a100efef18..e79879859b 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit a100efef186a5f8999fe3aa42c0720f5123c08eb +Subproject commit e79879859bc866545379eb77e1378a906dc30ebf diff --git a/gst/debug/gsttaginject.c b/gst/debug/gsttaginject.c index 7e2b81c8f9..896dfea74a 100644 --- a/gst/debug/gsttaginject.c +++ b/gst/debug/gsttaginject.c @@ -21,7 +21,7 @@ /** * SECTION:element-taginject * - * Element that inject new metadata tags, but passes incomming data through + * Element that injects new metadata tags, but passes incomming data through * unmodified. * |[ * gst-launch audiotestsrc num-buffers=100 ! taginject tags="title=testsrc,artist=gstreamer" ! vorbisenc ! oggmux ! filesink location=test.ogg @@ -67,8 +67,8 @@ static void gst_tag_inject_set_property (GObject * object, guint prop_id, static void gst_tag_inject_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -/*static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans, - GstBuffer * buf); */ +static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans, + GstBuffer * buf); static gboolean gst_tag_inject_start (GstBaseTransform * trans); @@ -120,8 +120,8 @@ gst_tag_inject_class_init (GstTagInjectClass * klass) gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tag_inject_finalize); - /*gstbasetrans_class->transform_ip = - GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip); */ + gstbasetrans_class->transform_ip = + GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip); gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_tag_inject_start); } @@ -132,15 +132,22 @@ gst_tag_inject_init (GstTagInject * self, GstTagInjectClass * g_class) self->tags = NULL; } -/* static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans, GstBuffer * buf) { GstTagInject *self = GST_TAG_INJECT (trans); + if (G_UNLIKELY (!self->tags_sent)) { + self->tags_sent = TRUE; + /* send tags */ + if (self->tags && !gst_tag_list_is_empty (self->tags)) { + gst_element_found_tags (GST_ELEMENT (trans), + gst_tag_list_copy (self->tags)); + } + } + return GST_FLOW_OK; } -*/ static void gst_tag_inject_set_property (GObject * object, guint prop_id, @@ -179,11 +186,8 @@ gst_tag_inject_start (GstBaseTransform * trans) { GstTagInject *self = GST_TAG_INJECT (trans); - /* send tags */ - if (self->tags && !gst_tag_list_is_empty (self->tags)) { - gst_element_found_tags (GST_ELEMENT (trans), - gst_tag_list_copy (self->tags)); - } + /* we need to sent tags _transform_ip() once */ + self->tags_sent = FALSE; return TRUE; } diff --git a/gst/debug/gsttaginject.h b/gst/debug/gsttaginject.h index 7c80ec0f58..4d0f04f132 100644 --- a/gst/debug/gsttaginject.h +++ b/gst/debug/gsttaginject.h @@ -54,6 +54,7 @@ struct _GstTagInject { /*< private >*/ GstTagList *tags; + gboolean tags_sent; }; struct _GstTagInjectClass {