From: Andy Wingo Date: Wed, 11 May 2005 03:20:15 +0000 (+0000) Subject: ext/vorbis/vorbisdec.c (vorbis_handle_comment_packet): Post a message to the bus... X-Git-Tag: 1.19.3~511^2~13056 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3aacd7982ec6601c6f03f703dd77d2c797be4bf5;p=platform%2Fupstream%2Fgstreamer.git ext/vorbis/vorbisdec.c (vorbis_handle_comment_packet): Post a message to the bus with the tags. Still not sent downst... Original commit message from CVS: * ext/vorbis/vorbisdec.c (vorbis_handle_comment_packet): Post a message to the bus with the tags. Still not sent downstream tho. * gst/playback/gstdecodebin.c (remove_element_chain): Unref after get_parent. (remove_element_chain): Use OBJECT_PARENT instead of get_parent to avoid refcounting hassles. --- diff --git a/ChangeLog b/ChangeLog index a799909..0dad868 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-05-10 Andy Wingo + + * ext/vorbis/vorbisdec.c (vorbis_handle_comment_packet): Post a + message to the bus with the tags. Still not sent downstream tho. + + * gst/playback/gstdecodebin.c (remove_element_chain): Unref after + get_parent. + (remove_element_chain): Use OBJECT_PARENT instead of get_parent to + avoid refcounting hassles. + 2005-05-09 Andy Wingo * gst/volume/Makefile.am: diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index f1e667f..3625155 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -442,6 +442,7 @@ static GstFlowReturn vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet) { gchar *encoder = NULL; + GstMessage *message; GstTagList *list; GstBuffer *buf; @@ -479,7 +480,8 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet) gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL); - //gst_element_found_tags_for_pad (GST_ELEMENT (vd), vd->srcpad, 0, list); + message = gst_message_new_tag ((GstObject *) vd, list); + gst_element_post_message (GST_ELEMENT (vd), message); return GST_FLOW_OK; } diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 8857ad3..314f088 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -671,9 +671,11 @@ get_our_ghost_pad (GstDecodeBin * decode_bin, GstPad * pad) if (parent == GST_ELEMENT (decode_bin)) { GST_DEBUG_OBJECT (decode_bin, "pad is our ghostpad"); + gst_object_unref (GST_OBJECT_CAST (parent)); return pad; } else { GST_DEBUG_OBJECT (decode_bin, "pad is ghostpad but not ours"); + gst_object_unref (GST_OBJECT_CAST (parent)); return NULL; } } @@ -702,7 +704,7 @@ static void remove_element_chain (GstDecodeBin * decode_bin, GstPad * pad) { GList *int_links; - GstElement *elem = gst_pad_get_parent (pad); + GstElement *elem = GST_ELEMENT (GST_OBJECT_PARENT (pad)); while (GST_OBJECT_PARENT (elem) && GST_OBJECT_PARENT (elem) != GST_OBJECT (decode_bin)) @@ -743,13 +745,18 @@ remove_element_chain (GstDecodeBin * decode_bin, GstPad * pad) GST_DEBUG_OBJECT (decode_bin, "internal pad %s:%s linked to pad %s:%s", GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (peer)); - if (gst_pad_get_real_parent (peer) != GST_ELEMENT (decode_bin)) { - GST_DEBUG_OBJECT (decode_bin, "dead end pad %s:%s", - GST_DEBUG_PAD_NAME (peer)); - } else { - GST_DEBUG_OBJECT (decode_bin, "recursing element %s on pad %s:%s", - gst_element_get_name (elem), GST_DEBUG_PAD_NAME (pad)); - remove_element_chain (decode_bin, peer); + { + GstElement *parent = gst_pad_get_real_parent (peer); + + if (parent != GST_ELEMENT (decode_bin)) { + GST_DEBUG_OBJECT (decode_bin, "dead end pad %s:%s", + GST_DEBUG_PAD_NAME (peer)); + } else { + GST_DEBUG_OBJECT (decode_bin, "recursing element %s on pad %s:%s", + gst_element_get_name (elem), GST_DEBUG_PAD_NAME (pad)); + remove_element_chain (decode_bin, peer); + } + gst_object_unref (GST_OBJECT_CAST (parent)); } } GST_DEBUG_OBJECT (decode_bin, "removing %s", gst_element_get_name (elem));