summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-07-18 18:52:23 +0000
committerDave Chapman <dave@dchapman.com>2006-07-18 18:52:23 +0000
commit98930fbe1e873b5a848d86d8a18d45e58f0538b1 (patch)
treee6ff5e66a9812f335b3f5b6f7d32658dbe516c4f
parent752faa4351f9caaa39d6c448490a1e740ea205b0 (diff)
downloadrockbox-98930fbe1e873b5a848d86d8a18d45e58f0538b1.zip
rockbox-98930fbe1e873b5a848d86d8a18d45e58f0538b1.tar.gz
rockbox-98930fbe1e873b5a848d86d8a18d45e58f0538b1.tar.bz2
rockbox-98930fbe1e873b5a848d86d8a18d45e58f0538b1.tar.xz
Oops - get_sid_metadata() isn't needed for hwcodec (fix warning).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10238 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata.c89
1 files changed, 45 insertions, 44 deletions
diff --git a/apps/metadata.c b/apps/metadata.c
index 546b97d..4f8d114 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -1270,6 +1270,51 @@ static bool get_musepack_metadata(int fd, struct mp3entry *id3)
id3->bitrate = id3->filesize*8/id3->length;
return true;
}
+
+static bool get_sid_metadata(int fd, struct mp3entry* id3)
+{
+ /* Use the trackname part of the id3 structure as a temporary buffer */
+ unsigned char* buf = id3->path;
+ int read_bytes;
+ char *p;
+
+
+ if ((lseek(fd, 0, SEEK_SET) < 0)
+ || ((read_bytes = read(fd, buf, sizeof(id3->path))) < 44))
+ {
+ return false;
+ }
+
+ if ((memcmp(buf, "PSID",4) != 0))
+ {
+ return false;
+ }
+
+ p = id3->id3v2buf;
+
+ /* Copy Title */
+ strcpy(p, &buf[0x16]);
+ id3->title = p;
+ p += strlen(p)+1;
+
+ /* Copy Artist */
+ strcpy(p, &buf[0x36]);
+ id3->artist = p;
+ p += strlen(p)+1;
+
+ id3->bitrate = 706;
+ id3->frequency = 44100;
+ /* New idea as posted by Marco Alanen (ravon):
+ * Set the songlength in seconds to the number of subsongs
+ * so every second represents a subsong.
+ * Users can then skip the current subsong by seeking */
+ id3->length = (buf[0xf]-1)*1000;
+ id3->vbr = false;
+ id3->filesize = filesize(fd);
+
+ return true;
+}
+
#endif /* CONFIG_CODEC == SWCODEC */
static bool get_aiff_metadata(int fd, struct mp3entry* id3)
@@ -1342,50 +1387,6 @@ static bool get_aiff_metadata(int fd, struct mp3entry* id3)
return true;
}
-static bool get_sid_metadata(int fd, struct mp3entry* id3)
-{
- /* Use the trackname part of the id3 structure as a temporary buffer */
- unsigned char* buf = id3->path;
- int read_bytes;
- char *p;
-
-
- if ((lseek(fd, 0, SEEK_SET) < 0)
- || ((read_bytes = read(fd, buf, sizeof(id3->path))) < 44))
- {
- return false;
- }
-
- if ((memcmp(buf, "PSID",4) != 0))
- {
- return false;
- }
-
- p = id3->id3v2buf;
-
- /* Copy Title */
- strcpy(p, &buf[0x16]);
- id3->title = p;
- p += strlen(p)+1;
-
- /* Copy Artist */
- strcpy(p, &buf[0x36]);
- id3->artist = p;
- p += strlen(p)+1;
-
- id3->bitrate = 706;
- id3->frequency = 44100;
- /* New idea as posted by Marco Alanen (ravon):
- * Set the songlength in seconds to the number of subsongs
- * so every second represents a subsong.
- * Users can then skip the current subsong by seeking */
- id3->length = (buf[0xf]-1)*1000;
- id3->vbr = false;
- id3->filesize = filesize(fd);
-
- return true;
-}
-
/* Simple file type probing by looking at the filename extension. */
unsigned int probe_file_format(const char *filename)
{