Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: [PATCH] set id3 tracknum from ID3 v1.1 tags
From: Kenneth Kiraly (ken_at_kiraly.com)
Date: 2002-09-06


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
@@ -116,10 +116,10 @@
 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;

@@ -127,7 +127,7 @@
         read(fd, buffer, 30);
         stripspaces(buffer);

- if(buffer[0]) {
+ if(buffer[0] || i == 3) {
             switch(i) {
             case 0:
                 strcpy(entry->id3v1buf[0], buffer);
@@ -141,6 +141,10 @@
                 strcpy(entry->id3v1buf[2], buffer);
                 entry->title = entry->id3v1buf[2];
                 break;
+ case 3:
+ if (buffer[28] == '\0')
+ entry->tracknum = (int)buffer[29];
+ break;
             }
         }
     }



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa