commit 02b61c600db6f952498492934aa2b1a4335a1111 Author: Javier Kohen <jko...@users.sourceforge.net> Date: Thu Sep 2 21:32:56 2010 +0200
Add support for the DATE field in VorbisComment. libgtkpod/oggfile.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) --- diff --git a/libgtkpod/oggfile.c b/libgtkpod/oggfile.c index f766fee..233470d 100644 --- a/libgtkpod/oggfile.c +++ b/libgtkpod/oggfile.c @@ -50,6 +50,13 @@ #include "vorbis/vorbisfile.h" #include "prefs.h" +/* + * The VorbisComment recommendation is too vague on the meaning and + * content of the fields: http://xiph.org/vorbis/doc/v-comment.html + * + * A widely used suggested usage of the fields can be found here: + * http://wiki.xiph.org/index.php/VorbisComment + */ Track *ogg_get_file_info (gchar *oggFileName) { Track *track = NULL; @@ -106,6 +113,14 @@ Track *ogg_get_file_info (gchar *oggFileName) if ((str=vorbis_comment_query(vc,"year",0))!=NULL){ track->year=atoi(str); } + if ((str=vorbis_comment_query(vc,"date",0))!=NULL){ + /* Expected format is YYYY-MM-DDTHH:MM:SS+TS + * The fields are optional from right to + * left. Year must always be present. Atoi() + * will always stop parsing at the first dash + * and return the year. */ + track->year=atoi(str); + } if ((str=vorbis_comment_query(vc,"tracknumber",0))!=NULL){ track->track_nr = atoi(str); } ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2