oggdemux: post/send tags with the container-format tag
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 14 Jun 2009 21:13:41 +0000 (22:13 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 14 Jun 2009 21:13:41 +0000 (22:13 +0100)
For this to work properly, theoradec and vorbisdec need to put
tag events received from upstream into the pending_events list
so they get pushed out after any newsegment event, not before.

ext/ogg/gstoggdemux.c
ext/theora/theoradec.c
ext/vorbis/vorbisdec.c

index 73d6f6d..21f98a5 100644 (file)
@@ -1834,9 +1834,13 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
   gst_element_no_more_pads (GST_ELEMENT (ogg));
 
   /* FIXME, must be sent from the streaming thread */
-  if (event)
+  if (event) {
     gst_ogg_demux_send_event (ogg, event);
 
+    gst_element_found_tags (GST_ELEMENT_CAST (ogg),
+        gst_tag_list_new_full (GST_TAG_CONTAINER_FORMAT, "Ogg", NULL));
+  }
+
   GST_DEBUG_OBJECT (ogg, "starting chain");
 
   /* then send out any queued buffers */
@@ -2957,7 +2961,7 @@ gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event)
       GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
 
       gst_event_ref (event);
-      GST_DEBUG_OBJECT (ogg, "Pushing event on pad %p", pad);
+      GST_DEBUG_OBJECT (pad, "Pushing event %" GST_PTR_FORMAT, event);
       gst_pad_push_event (GST_PAD (pad), event);
     }
   }
index 9746bf9..2614930 100644 (file)
@@ -721,6 +721,18 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
       }
       break;
     }
+    case GST_EVENT_TAG:
+    {
+      if (dec->have_header)
+        /* and forward */
+        ret = gst_pad_push_event (dec->srcpad, event);
+      else {
+        /* store it to send once we're initialized */
+        dec->pendingevents = g_list_append (dec->pendingevents, event);
+        ret = TRUE;
+      }
+      break;
+    }
     default:
       ret = gst_pad_push_event (dec->srcpad, event);
       break;
index c5517bb..e440085 100644 (file)
@@ -547,6 +547,18 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
       }
       break;
     }
+    case GST_EVENT_TAG:
+    {
+      if (dec->initialized)
+        /* and forward */
+        ret = gst_pad_push_event (dec->srcpad, event);
+      else {
+        /* store it to send once we're initialized */
+        dec->pendingevents = g_list_append (dec->pendingevents, event);
+        ret = TRUE;
+      }
+      break;
+    }
     default:
       ret = gst_pad_push_event (dec->srcpad, event);
       break;