Commit graph

9 commits

Author SHA1 Message Date
Tim-Philipp Müller
f25c715104 tag: id3v2: add debug category for ID3 tag parsing 2011-08-15 00:10:34 +01:00
Mark Nauwelaerts
08e6b5c54e tag: id3v2: add id3v2 tag parsing helpers
https://bugzilla.gnome.org/show_bug.cgi?id=654388
2011-08-15 00:10:34 +01:00
Tim-Philipp Müller
c2c21806ba tag: id3v2: fix parsing of unsync'ed ID3 v2.4 tags and frames
Reversing the unsynchronisation seems to work slightly differently
for ID3 v2.3 tags and v2.4 tags: v2.3 tags don't have syncsafe frame
sizes in the frame header, so the unsynchronisation is applied to
the whole frame data including all the frame headers. v2.4 frames
have sync-safe sizes, however, so the unsynchronisation only needs
to be applied to the actual frame data, and it seems that's what's
being done as well. So we need to undo the unsynchronisation on a
per-frame basis for v2.4 tags for things to work properly.

Fixes extraction of coverart/images from APIC frames in ID3 v2.4
tags (#588148).

Add unit test for this as well.
2011-08-15 00:10:32 +01:00
Tim-Philipp Müller
1dd5350109 tag: id3v2: We don't want the same string multiple times in a tag list for the same tag ever, for any tag, not jus...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2.c:
* gst-libs/gst/tag/id3v2.h:
* gst-libs/gst/tag/id3v2frames.c: (id3v2_tag_to_taglist):
We don't want the same string multiple times in a tag list for the
same tag ever, for any tag, not just for GST_TAG_GENRE, so make sure
this doesn't happen and remove special-case code for GST_TAG_GENRE.
2011-08-15 00:10:31 +01:00
Tim-Philipp Müller
2ff93c3826 tag: id3v2: Port ID3 tag demuxer over to the new GstTagDemux in -base (now would be a good time to test re-importi...
Original commit message from CVS:
* gst-libs/gst/tag/gstid3demux.c:
* gst-libs/gst/tag/gstid3demux.h:
* gst-libs/gst/tag/id3v2.c:
* gst-libs/gst/tag/id3v2.h:
* gst-libs/gst/tag/id3v2frames.c:
Port ID3 tag demuxer over to the new GstTagDemux in -base
(now would be a good time to test re-importing your music
collection).
2011-08-15 00:10:31 +01:00
Tim-Philipp Müller
c76c78670d tag: id3v2: Do not convert obsolete TDA/TDAT frames to TDRC frames, otherwise the four-digit number will be interp...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2.c: (id3demux_id3v2_frames_to_tag_list):
* gst-libs/gst/tag/id3v2.h:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_obsolete_tdat_frame):
Do not convert obsolete TDA/TDAT frames to TDRC frames, otherwise
the four-digit number will be interpreted as a year, whereas it is
month and day in DDMM format. Instead, parse TDAT frames and fix up
the date in the GST_TAG_DATE tag later if we also extracted a year.
Fixes #407349.
2011-08-15 00:10:30 +01:00
Tim-Philipp Müller
3f1bc48d0b tag: id3v2: On second thought, it might be wiser and more efficient not to do tag registration from a streaming th...
Original commit message from CVS:
* gst-libs/gst/tag/gstid3demux.c: (plugin_init):
* gst-libs/gst/tag/id3v2.c:
(id3demux_add_id3v2_frame_blob_to_taglist):
* gst-libs/gst/tag/id3v2.h:
On second thought, it might be wiser and more efficient
not to do tag registration from a streaming thread.
2011-08-15 00:10:29 +01:00
Jan Schmidt
a6f7ebffa2 tag: id3v2: Rewrite parsing of text tags to handle multiple NULL terminated strings. Parse numeric genre strings a...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2.c: (id3demux_read_id3v2_tag):
* gst-libs/gst/tag/id3v2.h:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_comment_frame), (parse_text_identification_frame),
(id3v2_tag_to_taglist), (id3v2_are_digits),
(id3v2_genre_string_to_taglist), (id3v2_genre_fields_to_taglist),
(parse_split_strings), (free_tag_strings):
Rewrite parsing of text tags to handle multiple NULL terminated
strings. Parse numeric genre strings and ID3v2 type
"(3)(6)Alternative" style genre strings.
Parse dates that are only YYYY or YYYY-mm format.
2011-08-15 00:10:26 +01:00
Jan Schmidt
83bffb642c tag: id3v2: all new LGPL id3 demuxer, can use zlib for compressed frames
Original commit message from CVS:
* configure.ac:
Check for optional dependency on zlib for id3demux

* gst-libs/gst/tag/Makefile.am:
* gst-libs/gst/tag/gstid3demux.c: (gst_gst_id3demux_get_type),
(gst_id3demux_base_init), (gst_id3demux_class_init),
(gst_id3demux_reset), (gst_id3demux_init), (gst_id3demux_dispose),
(gst_id3demux_add_srcpad), (gst_id3demux_remove_srcpad),
(gst_id3demux_trim_buffer), (gst_id3demux_chain),
(gst_id3demux_set_property), (gst_id3demux_get_property),
(id3demux_get_upstream_size), (gst_id3demux_srcpad_event),
(gst_id3demux_read_id3v1), (gst_id3demux_read_id3v2),
(gst_id3demux_sink_activate), (gst_id3demux_src_activate_pull),
(gst_id3demux_src_checkgetrange), (gst_id3demux_read_range),
(gst_id3demux_src_getrange), (gst_id3demux_change_state),
(gst_id3demux_pad_query), (gst_id3demux_get_query_types),
(simple_find_peek), (simple_find_suggest),
(gst_id3demux_do_typefind), (gst_id3demux_send_tag_event),
(plugin_init):
* gst-libs/gst/tag/gstid3demux.h:
* gst-libs/gst/tag/id3v2.c: (read_synch_uint),
(id3demux_read_id3v1_tag), (id3demux_read_id3v2_tag),
(id3demux_id3v2_frame_hdr_size), (convert_fid_to_v240),
(id3demux_id3v2_frames_to_tag_list):
* gst-libs/gst/tag/id3v2.h:
* gst-libs/gst/tag/id3v2.4.0-frames.txt:
* gst-libs/gst/tag/id3v2.4.0-structure.txt:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_comment_frame), (parse_text_identification_frame),
(id3v2_tag_to_taglist), (parse_split_strings):
All new LGPL id3 demuxer. Can use zlib for compressed frames,
otherwise it discards them. Works on my test files.

* gst/wavparse/gstwavparse.c: (gst_wavparse_loop):
Don't send EOS to a non-existing srcpad
The debug category can be static
2011-08-15 00:09:53 +01:00