diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-23 22:03:18 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-23 22:10:08 +0100 |
commit | 592bc87dc95d88e52fda9eec2d61828c2d6c6ec0 (patch) | |
tree | 50c2c077f82a24025da7ab240e860b627f861ffe | |
parent | 541da50c538788f3bf5f5e03d8f4c031643aa71a (diff) |
oggdemux: Extract tags from OGM text streams and don't push them downstream
-rw-r--r-- | ext/ogg/gstoggdemux.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 25cf12811..7713fd934 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -41,6 +41,7 @@ #endif #include <string.h> #include <gst/gst-i18n-plugin.h> +#include <gst/tag/tag.h> #include "gstoggdemux.h" @@ -501,6 +502,32 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet) /* We don't push header packets for OGM */ cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK); goto done; + } else if (data[0] & 3 && pad->map.is_ogm_text) { + GstTagList *tags; + + /* We don't push comment packets either for text streams, + * other streams will handle the comment packets in the + * decoder */ + buf = gst_buffer_new (); + + GST_BUFFER_DATA (buf) = (guint8 *) data; + GST_BUFFER_SIZE (buf) = bytes; + + tags = gst_tag_list_from_vorbiscomment_buffer (buf, + (guint8 *) "\003vorbis", 7, NULL); + gst_buffer_unref (buf); + buf = NULL; + + if (tags) { + GST_DEBUG_OBJECT (ogg, "tags = %" GST_PTR_FORMAT, tags); + gst_element_found_tags_for_pad (GST_ELEMENT (ogg), GST_PAD_CAST (pad), + tags); + } else { + GST_DEBUG_OBJECT (ogg, "failed to extract tags from vorbis comment"); + } + + cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK); + goto done; } offset = 1 + (((data[0] & 0xc0) >> 6) | ((data[0] & 0x02) << 1)); |