diff options
Diffstat (limited to 'gst/id3demux/gstid3demux.c')
-rw-r--r-- | gst/id3demux/gstid3demux.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index 9368504..414b574 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -55,7 +55,6 @@ #include <string.h> #include "gstid3demux.h" -#include "id3tags.h" enum { @@ -68,6 +67,9 @@ enum GST_DEBUG_CATEGORY (id3demux_debug); #define GST_CAT_DEFAULT (id3demux_debug) +#define ID3V1_TAG_SIZE 128 +#define ID3V2_HDR_SIZE GST_TAG_ID3V2_HEADER_SIZE + static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -94,8 +96,7 @@ gst_id3demux_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory)); + gst_element_class_add_static_pad_template (element_class, &sink_factory); gst_element_class_set_details_simple (element_class, "ID3 tag demuxer", "Codec/Demuxer/Metadata", @@ -142,7 +143,7 @@ gst_id3demux_identify_tag (GstTagDemux * demux, GstBuffer * buf, if (data[0] != 'I' || data[1] != 'D' || data[2] != '3') goto no_marker; - *tag_size = id3demux_calc_id3v2_tag_size (buf); + *tag_size = gst_tag_get_id3v2_tag_size (buf); } else { if (data[0] != 'T' || data[1] != 'A' || data[2] != 'G') goto no_marker; @@ -178,11 +179,10 @@ gst_id3demux_parse_tag (GstTagDemux * demux, GstBuffer * buffer, gboolean start_tag, guint * tag_size, GstTagList ** tags) { if (start_tag) { - ID3TagsResult res; /* FIXME: make id3tags.c return tagmuxresult values */ - - res = id3demux_read_id3v2_tag (buffer, tag_size, tags); + *tag_size = gst_tag_get_id3v2_tag_size (buffer); + *tags = gst_tag_list_from_id3v2_tag (buffer); - if (G_LIKELY (res == ID3TAGS_READ_TAG)) { + if (G_LIKELY (*tags != NULL)) { gst_id3demux_add_container_format (*tags); return GST_TAG_DEMUX_RESULT_OK; } else { @@ -276,11 +276,6 @@ plugin_init (GstPlugin * plugin) gst_tag_register_musicbrainz_tags (); - /* ensure private tag is registered */ - gst_tag_register (GST_ID3_DEMUX_TAG_ID3V2_FRAME, GST_TAG_FLAG_META, - GST_TYPE_BUFFER, "ID3v2 frame", "unparsed id3v2 tag frame", - gst_tag_merge_use_first); - return gst_element_register (plugin, "id3demux", GST_RANK_PRIMARY, GST_TYPE_ID3DEMUX); } |