Commit graph

58 commits

Author SHA1 Message Date
Tim-Philipp Müller 4246198fb3 No need for newlines in debug log statements 2017-04-12 09:58:49 +01:00
Thomas Bluemel cd101ce8f0 id3v2: fix splitting strings in ISO-8859-1 and UTF-16 formats
When parsing NUL-terminated strings, do not include the terminating
NUL byte(s).  Depending on the encoding used, either g_utf8_validate()
failed due to this, or worse the call to g_utf16_to_utf8() would
return 0 items read on an empty string, causing it to fail parsing
certain frames.

https://bugzilla.gnome.org/show_bug.cgi?id=770355
2016-12-25 10:52:39 +00:00
Ravi Kiran K N df5725e683 id3v2frames: Handle private frames
Handle PRIV ID3 tag having owner information (string)
and binary data, add to tag messages list.

https://bugzilla.gnome.org/show_bug.cgi?id=730926
2015-11-20 20:20:18 +00:00
Sebastian Dröge 8803ea2d8b id3v2frames: Fix compiler warnings
id3v2frames.c:951:20: error: unused variable 'utf16enc' [-Werror,-Wunused-const-variable]
static const gchar utf16enc[] = "UTF-16";
                   ^
id3v2frames.c:952:20: error: unused variable 'utf16leenc' [-Werror,-Wunused-const-variable]
static const gchar utf16leenc[] = "UTF-16LE";
                   ^
id3v2frames.c:953:20: error: unused variable 'utf16beenc' [-Werror,-Wunused-const-variable]
static const gchar utf16beenc[] = "UTF-16BE";
                   ^
2015-05-30 08:12:03 +02:00
Tim-Philipp Müller ea5d912b9f tag: id3v2: fix parsing of UTF-16 text on systems with crippled iconv
Use g_utf16_to_utf8() instead of the more generic g_convert(), so
that we can extract text in UTF-16 format even on embedded systems
with crippled iconv support.

This code path is exercised by the id3demux test_unsync_v23
check in gst-plugins-good.

https://bugzilla.gnome.org/show_bug.cgi?id=741144
2015-05-25 22:40:17 +01:00
Vincent Penquerc'h e2a9f0ef4e id3v2: ignore RVA2 tags with more than 64 peak bits
The spec for this does not say nor imply how this should be
interpreted.  The previous code would try to shift by 64 bits,
which is undefined.

Coverity 1195119

https://bugzilla.gnome.org/show_bug.cgi?id=727955
2015-03-30 12:33:06 +01:00
Sebastian Dröge 90eb93c2ef Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.
2014-12-01 09:51:12 +01:00
Marcin Lewandowski cd00206059 tag: ignore malformed ID3v2 TDAT frames
Just skip them, don't cause criticals.

https://bugzilla.gnome.org/show_bug.cgi?id=703283
2013-07-05 00:47:08 +01:00
Tim-Philipp Müller 5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Tim-Philipp Müller 54e9581a59 tag: extract dates from ID3v2 tags into GstDateTime instead of GDate
We may only have a year, or year and month+day, or (in future)
both date and time.
2012-07-14 15:37:46 +01:00
Sebastian Dröge 65307dd132 gst: Update versioning 2012-04-04 14:55:15 +02:00
Tim-Philipp Müller e96aaec6bb GST_TYPE_DATE -> G_TYPE_DATE 2012-01-12 23:35:44 +00:00
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
Erich Schubert afe6ee7f3c tag: id3v2: fix parsing of ID3v2.4 genre frames with multiple genres
We'd only extract the first genre (multiple times) instead of all
genres.

https://bugzilla.gnome.org/show_bug.cgi?id=638535
2011-08-15 00:10:34 +01:00
Tim-Philipp Müller 366ed8edb4 tag: id3v2: fix parsing of unsynced frames with data length indicator
Fixes bug #614158.
2011-08-15 00:10:34 +01:00
Tim-Philipp Müller e4752b52b8 tag: id3v2: prefer two letter ISO 639-1 code for extended comment 2011-08-15 00:10:34 +01:00
Stefan Kost ed05fcfb2c tag: id3v2: fprintf, sprintf, sscanf need stdio.h 2011-08-15 00:10:33 +01:00
Alessandro Decina 4a885b094f tag: id3v2: Fix compile warnings with gcc 4.0.1. 2011-08-15 00:10:33 +01:00
LoneStar 687055c852 tag: id3v2: Try GST_*_TAG_ENCODING and locale encoding if tags are not UTF8
Fixes bug #499242.
2011-08-15 00:10:32 +01:00
Tim-Philipp Müller 09b26dbf5c tag: id3v2: sizes in ID3 v2.3 are unlikely to be sync-safe integers
In ID3 v2.3 compressed frames will have a 4-byte data length indicator
after the frame header to indicate the size of the decompressed data.
This integer is unlikely to be a sync-safe integer for v2.3 tags,
only in v2.4 it's sync-safe.
2011-08-15 00:10:32 +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 a91620dbdf tag: id3v2: Use new utility functions in libgsttag to process coverart (#512333).
Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_extract_picture_buffer):
* gst-libs/gst/tag/id3v2frames.c: (parse_picture_frame):
Use new utility functions in libgsttag to process coverart (#512333).
2011-08-15 00:10:32 +01:00
Jan Schmidt 904051e9d4 tag: id3v2: Generate the image-type values correctly. Leave them out of the caps when outputting a "preview image" tag, since it ...
Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_extract_picture_buffer):
* gst-libs/gst/tag/id3v2frames.c: (parse_picture_frame):
Generate the image-type values correctly. Leave them out of the caps
when outputting a "preview image" tag, since it only makes sense
to have one of those - the type is irrelevant.
* sys/sunaudio/gstsunaudiomixerctrl.c:
(gst_sunaudiomixer_ctrl_open):
If we can, mark the mixer multiple open when we use it, in case
(for some reason) the process wants to open it again elsewhere.
2011-08-15 00:10:32 +01:00
Tommi Myöhänen 6d7fcfbcde tag: id3v2: Make sure the ISO 639-X language code in ID3v2 COMM frames so we don't end up with non-UT...
Original commit message from CVS:
Based on patch by: Tommi Myöhänen <ext-tommi.myohanen nokia com>
* gst-libs/gst/tag/id3v2frames.c: (parse_comment_frame):
Make sure the ISO 639-X language code in ID3v2 COMM frames
is actually valid UTF-8 (or rather: ASCII), so we don't end
up with non-UTF8 strings in tags if there's garbage in the
language field. Also make sure the language code is always
lower case. Fixes: #508291.
2011-08-15 00:10:31 +01:00
Tim-Philipp Müller d4b43861a2 tag: id3v2: Parse WOAF frames and put the result into GST_TAG_CONTACT, which is where it would end up...
Original commit message from CVS:
* tag: id3v2: (parse_url_link_frame):
Parse WOAF frames and put the result into GST_TAG_CONTACT,
which is where it would end up if the same information was
put in a vorbis comment (don't think it's worth adding a
new URI tag for this). Fixes #488112.
2011-08-15 00:10:31 +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
Jason Kivlighn 66c4980024 tag: id3v2: Extract license/copyright URIs from ID3v2 WCOP frames (Fixes #447000).
Original commit message from CVS:
Based on patch by: Jason Kivlighn  <jkivlighn gmail com>
* gst-libs/gst/tag/id3v2frames.c:
Extract license/copyright URIs from ID3v2 WCOP frames
(Fixes #447000).
* tests/check/elements/id3demux.c:
* tests/files/Makefile.am:
* tests/files/id3-447000-wcop.tag:
Add simple unit test.
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 0277ee0b79 tag: id3v2: Fix parsing of ID3 v2.2.0 PIC frames. Only in version >= 2.3.0 is the image format a vari...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_picture_frame):
Fix parsing of ID3 v2.2.0 PIC frames. Only in version >= 2.3.0 is
the image format a variable-length NUL-terminated string; in
versions before that the image format is a fixed-length string of
3 characters (see #348644 for a sample tag).
Also make supplied mime type lower-case and fix up 'jpg' to 'jpeg'.
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
René Stadler 763eea481e tag: id3v2: Make sure that g_free always gets called on the same pointer that was returned by g_mallo...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame):
Make sure that g_free always gets called on the same pointer that was
returned by g_malloc.  Fixes #376594.
Do not leak memory if decompressed size is wrong.
Remove unneeded check of return value of g_malloc.
Patch by: René Stadler <mail@renestadler.de>
2011-08-15 00:10:30 +01:00
Tim-Philipp Müller 07feb53dbd tag: id3v2: We require a -base more recent than 0.10.9, so it's safe to use
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_picture_frame):
We require a -base more recent than 0.10.9, so it's safe to use
GST_TYPE_TAG_IMAGE_TYPE unconditionally now.
* ext/dv/gstdvdec.c: (gst_dvdec_sink_event):
* ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_sink_event):
Use _newsegment_full() now that we depend on a recent enough core.
* gst/wavparse/gstwavparse.c:
Remove cruft that we don't need any longer now that we depend on
a recent enough -base.
2011-08-15 00:10:30 +01:00
Tim-Philipp Müller bac37d9917 tag: id3v2: Printf format fixes.
Original commit message from CVS:
* ext/cairo/gsttimeoverlay.c:
(gst_cairo_time_overlay_update_font_height):
* ext/gdk_pixbuf/pixbufscale.c: (gst_pixbufscale_transform_caps):
* ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_parse_image_data):
* ext/jpeg/gstjpegenc.c: (gst_jpegenc_chain):
* ext/jpeg/gstsmokedec.c: (gst_smokedec_chain):
* ext/jpeg/gstsmokeenc.c: (gst_smokeenc_chain):
* ext/libpng/gstpngdec.c: (user_endrow_callback):
* gst/auparse/gstauparse.c: (gst_au_parse_parse_header):
* gst/avi/gstavidemux.c: (gst_avi_demux_parse_superindex),
(gst_avi_demux_parse_subindex), (gst_avi_demux_parse_stream),
(gst_avi_demux_stream_data):
* gst/cutter/gstcutter.c: (gst_cutter_chain):
* gst/debug/efence.c: (gst_efence_buffer_alloc),
(gst_fenced_buffer_copy):
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_start):
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_send),
(gst_rtspsrc_handle_message):
* gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers):
* sys/ximage/ximageutil.c: (ximageutil_xcontext_get):
Printf format fixes.
2011-08-15 00:10:30 +01:00
Jan Schmidt 8bdde43777 tag: id3v2: If strings in text fields are marked ISO8859-1, but contain valid UTF-8 already, then han...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_text_identification_frame),
(parse_insert_string_field):
If strings in text fields are marked ISO8859-1, but contain
valid UTF-8 already, then handle them as UTF-8 and ignore
the encoding. (#351794)
2011-08-15 00:10:30 +01:00
Tim-Philipp Müller 075ceac5e7 configure.ac: Require CVS of GStreamer core and -base (for
Original commit message from CVS:
* configure.ac:
Require CVS of GStreamer core and -base (for
GST_TAG_EXTENDED_COMMENT and gst_tag_parse_extended_comment()).
* ext/taglib/gstid3v2mux.cc:
Write extended comment tags properly (#348762).
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_comment_frame):
Extract COMM frames into extended comments, which makes it
easier to properly retain the description bit of the tag
and maintain this information when re-tagging (#348762).
2011-08-15 00:10:29 +01:00
Tim-Philipp Müller f0a1b71dfe tag: id3v2: Set image type from APIC frame as "image-type" field of GST_TAG_IMAGE buffer caps (#344605).
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_picture_frame):
Set image type from APIC frame as "image-type" field
of GST_TAG_IMAGE buffer caps (#344605).
2011-08-15 00:10:29 +01:00
Tim-Philipp Müller 1cc10b3611 tag: id3v2: Extract images from ID3v2 tags (APIC frames). Fixes #339704.
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(scan_encoded_string), (parse_picture_frame):
Extract images from ID3v2 tags (APIC frames). Fixes #339704.
* configure.ac:
Require core >= 0.10.8 (for GST_TAG_IMAGE and
GST_TAG_PPEVIEW_IMAGE used in the patch above).
2011-08-15 00:10:29 +01:00
Tim-Philipp Müller 6f5e16f4ba tag: id3v2: A track/volume number or count of 0 does not make sense, just ignore it along with negati...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3v2_tag_to_taglist):
A track/volume number or count of 0 does not make sense,
just ignore it along with negative numbers (a tag might
only contain a track count without a track number).
2011-08-15 00:10:28 +01:00
Jan Schmidt 7e7ee7278b tag: id3v2: Don't output any tag when we encounter a negative track number - the tag type is uint, so...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3v2_tag_to_taglist):
Don't output any tag when we encounter a negative track number - the
tag type is uint, so we end up outputting huge positive numbers
instead. (Fixes: #342029)
2011-08-15 00:10:28 +01:00
Jan Schmidt 5b67108b7d tag: id3v2: Rework string parsing to always walk over BOM markers in UTF16 strings, using the endianness indicated by the innermost one ...
Original commit message from CVS:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_find_best):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_find_best):
Make the name of the child element be based on the name of the
parent, so that debug output is more useful.
* gst-libs/gst/tag/id3v2frames.c: (find_utf16_bom),
(parse_insert_string_field), (parse_split_strings):
Rework string parsing to always walk over BOM markers in UTF16
strings, using the endianness indicated by the innermost one,
then trying the opposite endianness if that fails to convert
to valid UTF-8. Fixes #341774
2011-08-15 00:10:28 +01:00
Tim-Philipp Müller 2fd7d6c3eb tag: id3v2: Some more debug info. No need to check whether the string returned by g_convert() is real...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_insert_string_field):
Some more debug info. No need to check whether the string
returned by g_convert() is really UTF-8 - either it is or
we get NULL returned.
2011-08-15 00:10:28 +01:00
Jan Schmidt 9f4827af39 tag: id3v2: Fix parsing of numeric genre strings some more, by ensuring that we only try and parse st...
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3v2_genre_fields_to_taglist):
Fix parsing of numeric genre strings some more, by ensuring that
we only try and parse strings that a) Start with '(' and b) Consist
only of digits.
Also, when finding an escaping '((' sequence, bust it back to '(' by
swallowing the first parenthesis
2011-08-15 00:10:28 +01:00
Tim-Philipp Müller 1b885bafba tag: id3v2: Recognise and skip any byte order marker (BOM) in
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (has_utf16_bom),
(parse_split_strings):
Recognise and skip any byte order marker (BOM) in
UTF-16 strings.
2011-08-15 00:10:28 +01:00
Sébastien Moutte 571d8f9d86 tag: id3v2: use of GST_DEBUG instead of DEBUG(a...) for WIN32
Original commit message from CVS:
* ext\jpeg\smokecodec.c:
use of GST_DEBUG instead of DEBUG(a...) for WIN32
* ext\speex\gstspeexenc.c: (gst_speexenc_set_header_on_caps):
move first instruction after all variables declarations
* gst\alpha\gstalpha.c:
* gst\effectv\gstshagadelic.c:
* gst\smpte\paint.c:
* gst\videofilter\gstvideobalance.c:
define M_PI if it's not defined (it's not defined on WIN32)
* gst\cutter\gstcutter.c: (gst_cutter_chain):
* gst\id3demux\id3v2frames.c: (parse_relative_volume_adjustment_two):
* gst\level\gstlevel.c: (gst_level_set_property), (gst_level_transform_ip):
* gst\matroska\matroska-demux.c: (gst_matroska_demux_parse_info),
(gst_matroska_demux_video_caps):
* gst\matroska\matroska-mux.c: (gst_matroska_mux_start), (gst_matroska_mux_finish):
* gst\wavparse\gstwavparse.c: (gst_wavparse_stream_data):
use gst_guint64_to_gdouble for conversions
* gst\goom\filters.c: (setPixelRGB_):
fix a debug which was using undefined variable
* gst\level\gstlevel.c: (gst_level_set_caps), (gst_level_transform_ip):
* gst\matroska\ebml-read.c: (gst_ebml_read_sint):
replace LL suffix with L suffix (LL isn't supported by MSVC6.0)
* win32/vs6:
add vs6 projects files for most of plugins-good
2011-08-15 00:10:27 +01:00
Tim-Philipp Müller 17be9f715b tag: id3v2: We only care about gain and peak data for the master volume.
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c:
(parse_relative_volume_adjustment_two):
We only care about gain and peak data for the master volume.
2011-08-15 00:10:27 +01:00
Tim-Philipp Müller 84cc22cacc tag: id3v2: Read replay gain tags
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_id_string), (parse_unique_file_identifier),
(parse_relative_volume_adjustment_two), (id3v2_tag_to_taglist):
Read replay gain tags (#323721).
2011-08-15 00:10:27 +01:00
Tim-Philipp Müller d8900f72b5 configure.ac: Bump -base requirement to 0.10.5 for gst_tag_from_id3_user_tag(), used by id3demux.
Original commit message from CVS:
* configure.ac:
Bump -base requirement to 0.10.5 for gst_tag_from_id3_user_tag(),
used by id3demux.
* gst-libs/gst/tag/gstid3demux.c: (plugin_init):
* gst-libs/gst/tag/id3v2frames.c: (id3demux_id3v2_parse_frame),
(parse_user_text_identification_frame),
(parse_unique_file_identifier):
Add support for UFID and TXXX frames and extract musicbrainz tags.
2011-08-15 00:10:27 +01:00
Jan Schmidt dbcf8fc320 tag: id3v2: Handle 0 data size in otherwise valid frames.
Original commit message from CVS:
* gst-libs/gst/tag/id3v2.c: (id3demux_id3v2_frames_to_tag_list):
* gst-libs/gst/tag/id3v2frames.c: (id3v2_genre_fields_to_taglist):
Handle 0 data size in otherwise valid frames.
Handle numeric strings in 2.4.0 even when not in parentheses
2011-08-15 00:10:27 +01:00
Jan Schmidt dc5506d372 tag: id3v2: Add more validation to ensure that a char encoding conversion produced a valid UTF-8 string.
Original commit message from CVS:
* gst-libs/gst/tag/id3v2frames.c: (parse_insert_string_field),
(parse_split_strings):
Add more validation to ensure that a char encoding conversion
produced a valid UTF-8 string.
2011-08-15 00:10:27 +01:00