diff options
author | Sreerenj Balachandran <sreerenj.balachandran@nokia.com> | 2010-09-14 23:08:51 +0300 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-12-03 13:53:54 +0100 |
commit | 2319c85f469b92221dd86e9d89dda268a8a127b4 (patch) | |
tree | e9000aa0a5d080a0ade480a792119927dd823c63 /ext/ogg/gstoggdemux.c | |
parent | 7c4fcf776fc3f2ec9614dc623699c47412b493ee (diff) |
oggdemux: perform more (vorbis comment header) tag extractions
In particular, move comment header parsing to gstoggstrem.c.
Thanks to Felipe Contreras.
Fixes #629349 (partially).
Diffstat (limited to 'ext/ogg/gstoggdemux.c')
-rw-r--r-- | ext/ogg/gstoggdemux.c | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 6f831760f..20eba9a44 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -452,36 +452,10 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, if (bytes < 1) goto empty_packet; - if (data[0] & 1) { + if ((data[0] & 1) || (data[0] & 3 && pad->map.is_ogm_text)) { /* 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, - (const 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)); @@ -497,32 +471,9 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, } } } else if (pad->map.is_vp8) { - if (packet->bytes >= 7 && memcmp (packet->packet, "OVP80\2 ", 7) == 0) { - GstTagList *tags; - - buf = gst_buffer_new (); - - GST_BUFFER_DATA (buf) = (guint8 *) packet->packet; - GST_BUFFER_SIZE (buf) = packet->bytes; - - tags = gst_tag_list_from_vorbiscomment_buffer (buf, - (const guint8 *) "OVP80\2 ", 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 VP8 tags from vorbis comment"); - } - /* We don't push header packets for VP8 */ - cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK); - goto done; - } else if (packet->b_o_s || (packet->bytes >= 5 - && memcmp (packet->packet, "OVP80", 5) == 0)) { + if ((packet->bytes >= 7 && memcmp (packet->packet, "OVP80\2 ", 7) == 0) || + packet->b_o_s || + (packet->bytes >= 5 && memcmp (packet->packet, "OVP80", 5) == 0)) { /* We don't push header packets for VP8 */ cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK); goto done; @@ -1791,6 +1742,10 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain, gst_element_add_pad (GST_ELEMENT (ogg), GST_PAD_CAST (pad)); pad->added = TRUE; + if (event && pad->map.taglist) { + gst_element_found_tags_for_pad (GST_ELEMENT_CAST (ogg), + GST_PAD_CAST (pad), pad->map.taglist); + } } /* prefer the index bitrate over the ones encoded in the streams */ ogg->bitrate = (idx_bitrate ? idx_bitrate : bitrate); |