diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2007-03-06 18:16:49 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2007-03-06 18:16:49 +0000 |
commit | 8ffc1761b31c7a6c425853e16d87a907d9a4e6c7 (patch) | |
tree | 6fcc7a8796cee75da24a4ba9786f28c45329db50 /gst/id3demux/id3tags.c | |
parent | c71db98b91702454dc530811d0aefc21de873820 (diff) |
gst/id3demux/: Do not convert obsolete TDA/TDAT frames to TDRC frames, otherwise the four-digit number will be interp...
Original commit message from CVS:
* gst/id3demux/id3tags.c: (id3demux_id3v2_frames_to_tag_list):
* gst/id3demux/id3tags.h:
* gst/id3demux/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.
Diffstat (limited to 'gst/id3demux/id3tags.c')
-rw-r--r-- | gst/id3demux/id3tags.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gst/id3demux/id3tags.c b/gst/id3demux/id3tags.c index 7e354f2a..249acd0a 100644 --- a/gst/id3demux/id3tags.c +++ b/gst/id3demux/id3tags.c @@ -242,7 +242,6 @@ const struct ID3v2FrameIDConvert } frame_id_conversions[] = { /* 2.3.x frames */ { - "TDAT", "TDRC"}, { "TORY", "TDOR"}, { "TYER", "TDRC"}, /* 2.2.x frames */ @@ -266,7 +265,7 @@ const struct ID3v2FrameIDConvert "TCM", "TCOM"}, { "TCO", "TCON"}, { "TCR", "TCOP"}, { - "TDA", "TDRC"}, { + "TDA", "TDAT"}, { /* obsolete, but we need to parse it anyway */ "TDY", "TDLY"}, { "TEN", "TENC"}, { "TFT", "TFLT"}, { @@ -500,5 +499,18 @@ id3demux_id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size) return ID3TAGS_BROKEN_TAG; } + /* Set day/month now if they were in a separate (obsolete) TDAT frame */ + if (work->pending_day != 0 && work->pending_month != 0) { + GDate *date = NULL; + + if (gst_tag_list_get_date (work->tags, GST_TAG_DATE, &date)) { + g_date_set_day (date, work->pending_day); + g_date_set_month (date, work->pending_month); + gst_tag_list_add (work->tags, GST_TAG_MERGE_REPLACE, GST_TAG_DATE, + date, NULL); + g_date_free (date); + } + } + return ID3TAGS_READ_TAG; } |