9 #include "metadata_common.h"
10 #include "metadata_parsers.h"
11 #include "rbunicode.h"
13 bool get_nsf_metadata(int fd
, struct mp3entry
* id3
)
15 /* Use the trackname part of the id3 structure as a temporary buffer */
16 unsigned char* buf
= (unsigned char *)id3
->path
;
21 if ((lseek(fd
, 0, SEEK_SET
) < 0)
22 || ((read_bytes
= read(fd
, buf
, 110)) < 110))
27 id3
->length
= 120*1000;
29 id3
->filesize
= filesize(fd
);
31 if (memcmp(buf
,"NSFE",4) == 0) /* only NESM contain metadata */
37 if (memcmp(buf
, "NESM",4) != 0) /* not a valid format*/
46 memcpy(p
, &buf
[14], 32);
51 memcpy(p
, &buf
[46], 32);
55 /* Copyright (per codec) */
56 memcpy(p
, &buf
[78], 32);