GNOME Bugzilla – Bug 357532
[gsttag] vorbistag doesn't handle dates that include timestamps
Last modified: 2006-09-25 10:22:27 UTC
gstvorbistag.c doesn't handle dates that include timestamps. For example if you download the ogg version of this album: http://www.jamendo.com/en/album/2534/ The tracks all have timestamps after the date, e.g.: ogginfo 01\ -\ Ventus\ Solaris.ogg Processing file "01 - Ventus Solaris.ogg"... New logical stream (#1, serial: 6a79bd1a): type vorbis Vorbis headers parsed for stream 1, information follows... Version: 0 Vendor: Xiph.Org libVorbis I 20040629 (1.1.0 rc1) Channels: 2 Rate: 44100 Nominal bitrate: 224.000000 kb/s Upper bitrate not set Lower bitrate not set User comments section follows... ARTIST=Revolution Void ALBUM=Thread Soul TRACKNUMBER=1 TITLE=Ventus Solaris DATE=2006-08-21 22:02:38 ORGANIZATION=Jamendo : http://www.jamendo.com/ COMMENT=Jamendo : http://www.jamendo.com/ DESCRIPTION=Jamendo : http://www.jamendo.com/ WWW=http://www.jamendo.com/album/2534 LICENSE=http://creativecommons.org/licenses/by-nc/2.5/ WCOP=http://creativecommons.org/licenses/by-nc/2.5/ WOAF=http://www.jamendo.com/track/17954 Vorbis stream 1: Total data length: 10870973 bytes Playback length: 6m:54.730s Average bitrate: 209.697206 kb/s Logical stream 1 ended This can be fixed trivially, if you really only care about the first part (the date itself) being correct, by not checking for the terminating character: diff -u -r1.18 gstvorbistag.c --- gstvorbistag.c 23 Sep 2006 13:21:07 -0000 1.18 +++ gstvorbistag.c 24 Sep 2006 22:50:19 -0000 @@ -244,7 +244,8 @@ d = strtoul (check, &check, 10); } } - if (*check == '\0' && y != 0 && g_date_valid_dmy (d, m, y)) { + if (y != 0 && g_date_valid_dmy (d, m, y)) { + //if (*check == '\0' && y != 0 && g_date_valid_dmy (d, m, y)) { GDate *date; date = g_date_new_dmy (d, m, y); Although I'm not sure if this is a robust solution. Perhaps it could parse the time as well (just be sure it's not garbage), and then ignore it. In either case, many of the tracks (which are all Creative Commons licensed) on http://www.jamendo.com/ appear to format the date this way (and there are probably other sites that do so as well), that it would seem to make sense to be able to gracefully handle these datestamps even if they are slightly out of the vorbis spec.
Just to show that gst doesn't find the date: $ gst-launch-0.10 -t playbin uri=file:///tmp/song.ogg FOUND TAG : found by element "vorbisdec1". artist: Revolution Void album: Thread Soul track number: 1 title: Ventus Solaris organization: Jamendo : http://www.jamendo.com/ comment: Jamendo : http://www.jamendo.com/ description: Jamendo : http://www.jamendo.com/ extended comment: WWW=http://www.jamendo.com/album/2534 : WCOP=http://creativecommons.org/licenses/by-nc/2.5/ : WOAF=http://www.jamendo.com/track/17954 license: http://creativecommons.org/licenses/by-nc/2.5/ encoder: Xiph.Org libVorbis I 20040629 encoder version: 0 audio codec: Vorbis nominal bitrate: 224000 bitrate: 224000
Thanks for the report, should be fixed in CVS now: 2006-09-25 Tim-Philipp Müller <tim at centricular dot net> * gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add): Parse dates that are followed by a time as well (#357532). * tests/check/libs/tag.c: (test_vorbis_tags): Add unit test for this.