ext/vorbis/vorbisdec.c (vorbis_handle_comment_packet): Post a message to the bus...
authorAndy Wingo <wingo@pobox.com>
Wed, 11 May 2005 03:20:15 +0000 (03:20 +0000)
committerAndy Wingo <wingo@pobox.com>
Wed, 11 May 2005 03:20:15 +0000 (03:20 +0000)
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.

ChangeLog
ext/vorbis/vorbisdec.c
gst/playback/gstdecodebin.c

index a799909..0dad868 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-05-10  Andy Wingo  <wingo@pobox.com>
+
+       * 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  <wingo@pobox.com>
 
        * gst/volume/Makefile.am:
index f1e667f..3625155 100644 (file)
@@ -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;
 }
index 8857ad3..314f088 100644 (file)
@@ -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));