|
Rockbox mail archiveSubject: [PATCH] set id3 tracknum from ID3 v1.1 tags[PATCH] set id3 tracknum from ID3 v1.1 tags
From: Kenneth Kiraly <ken_at_kiraly.com>
Date: Fri, 6 Sep 2002 07:10:54 -0700 Now that we have configurable WPS (great feature!), I found that "%in" didn't display anything for any of my MP3s (they use ID3 v1.1 tags.) This is a very simple patch to "setid3v1title" that sets the mp3entry track number from MP3s that use v1.1 tags - with this change "%in" will work properly for WPS for these MP3s. Keep up the great work on Rockbox - it totally rocks! Thanks, Ken Index: id3.c =================================================================== RCS file: /cvsroot/rockbox/firmware/id3.c,v retrieving revision 1.40 diff -u -b -r1.40 id3.c --- id3.c 30 Aug 2002 22:01:35 -0000 1.40 +++ id3.c 6 Sep 2002 05:07:18 -0000 _at__at_ -116,10 +116,10 _at__at_ static bool setid3v1title(int fd, struct mp3entry *entry) { char buffer[31]; - int offsets[3] = {-95,-65,-125}; + int offsets[4] = {-95,-65,-125,-31}; int i; - for(i=0;i<3;i++) { + for(i=0;i<4;i++) { if(-1 == lseek(fd, offsets[i], SEEK_END)) return false; _at__at_ -127,7 +127,7 _at__at_ read(fd, buffer, 30); stripspaces(buffer); - if(buffer[0]) { + if(buffer[0] || i == 3) { switch(i) { case 0: strcpy(entry->id3v1buf[0], buffer); _at__at_ -141,6 +141,10 _at__at_ strcpy(entry->id3v1buf[2], buffer); entry->title = entry->id3v1buf[2]; break; + case 3: + if (buffer[28] == '\0') + entry->tracknum = (int)buffer[29]; + break; } } } Received on 2002-09-06 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |