summaryrefslogtreecommitdiffstats
path: root/gst/apetag
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-04 12:05:34 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-12-04 12:05:34 +0000
commit0c3cca89fc0b62a50d74a7140e1afb690c4bfb72 (patch)
tree8d74e49feb1b5abdd36e8ece7bae233110ced7e0 /gst/apetag
parent4f3815cb3a8e4648cbb7f69f97b4f74ac7439edc (diff)
downloadgst-plugins-bad-0c3cca89fc0b62a50d74a7140e1afb690c4bfb72.tar.gz
gst-plugins-bad-0c3cca89fc0b62a50d74a7140e1afb690c4bfb72.tar.bz2
gst-plugins-bad-0c3cca89fc0b62a50d74a7140e1afb690c4bfb72.zip
gst/apetag/apedemux.c: Forward tags, too.
Original commit message from CVS: * gst/apetag/apedemux.c: (gst_ape_demux_parse_tags), (gst_ape_demux_stream_init): Forward tags, too.
Diffstat (limited to 'gst/apetag')
-rw-r--r--gst/apetag/apedemux.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/gst/apetag/apedemux.c b/gst/apetag/apedemux.c
index 0722595c..0c232261 100644
--- a/gst/apetag/apedemux.c
+++ b/gst/apetag/apedemux.c
@@ -421,7 +421,7 @@ gst_ape_demux_typefind (GstApeDemux * ape,
* Parse tags from a buffer.
*/
-static void
+static GstTagList *
gst_ape_demux_parse_tags (GstApeDemux * ape, guint8 * data, gint size)
{
GstTagList *taglist = gst_tag_list_new ();
@@ -501,10 +501,13 @@ gst_ape_demux_parse_tags (GstApeDemux * ape, guint8 * data, gint size)
/* let people know */
if (have_tag) {
gst_element_found_tags (GST_ELEMENT (ape), taglist);
- /*gst_pad_push (ape->srcpad, GST_DATA (gst_event_new_tag (taglist))); */
+ /* we'll push it over the srcpad later */
} else {
gst_tag_list_free (taglist);
+ taglist = NULL;
}
+
+ return taglist;
}
/*
@@ -518,6 +521,7 @@ gst_ape_demux_stream_init (GstApeDemux * ape)
gboolean seekable = TRUE, res = TRUE;
guint8 *data;
guint32 size = 0;
+ GstTagList *taglist1 = NULL, *taglist2 = NULL, *taglist = NULL;
GST_LOG ("Initializing stream, stripping tags");
@@ -568,7 +572,7 @@ gst_ape_demux_stream_init (GstApeDemux * ape)
goto the_city;
}
}
- gst_ape_demux_parse_tags (ape, data, size);
+ taglist1 = gst_ape_demux_parse_tags (ape, data, size);
ape->start_off = size;
}
@@ -633,7 +637,7 @@ gst_ape_demux_stream_init (GstApeDemux * ape)
data += 32;
size -= 32;
}
- gst_ape_demux_parse_tags (ape, data, size);
+ taglist2 = gst_ape_demux_parse_tags (ape, data, size);
ape->end_off = size;
}
@@ -671,6 +675,25 @@ gst_ape_demux_stream_init (GstApeDemux * ape)
the_city:
/* become rich & famous */
gst_bytestream_destroy (bs);
+ if (taglist1 || taglist2) {
+ if (res) {
+ /* merge */
+ if (taglist1 && taglist2) {
+ taglist = gst_tag_list_merge (taglist1, taglist2,
+ GST_TAG_MERGE_REPLACE);
+ gst_tag_list_free (taglist1);
+ gst_tag_list_free (taglist2);
+ } else {
+ taglist = taglist1 ? taglist1 : taglist2;
+ }
+ gst_pad_push (ape->srcpad, GST_DATA (gst_event_new_tag (taglist)));
+ } else {
+ if (taglist1)
+ gst_tag_list_free (taglist1);
+ if (taglist2)
+ gst_tag_list_free (taglist2);
+ }
+ }
return res;
}