summaryrefslogtreecommitdiffstats
path: root/apps/metadata/id3tags.c
diff options
context:
space:
mode:
authorNick Peskett <rockbox@peskett.co.uk>2011-12-18 00:00:41 +0000
committerNick Peskett <rockbox@peskett.co.uk>2011-12-18 00:00:41 +0000
commitae90b29dcb56cf74d4d561fed33a6c843d469b55 (patch)
treee43b42850eaece87ff2f40314dce2ff958cacf2f /apps/metadata/id3tags.c
parent73627cef6233d61df2c95d43339b7cc715f3434d (diff)
downloadrockbox-ae90b29dcb56cf74d4d561fed33a6c843d469b55.tar.gz
rockbox-ae90b29dcb56cf74d4d561fed33a6c843d469b55.tar.bz2
rockbox-ae90b29dcb56cf74d4d561fed33a6c843d469b55.zip
Hard code the cuesheet offset for double byte encoding, rather than pointless calculation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31348 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/id3tags.c')
-rw-r--r--apps/metadata/id3tags.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c
index e9b59e012a..855394e2c3 100644
--- a/apps/metadata/id3tags.c
+++ b/apps/metadata/id3tags.c
@@ -1000,7 +1000,7 @@ void setid3v2title(int fd, struct mp3entry *entry)
(bytesread >= 14 && !strncmp(utf8buf, "CUESHEET", 8))
) {
unsigned char char_enc = 0;
- /* 0CUESHEET0 = 10 bytes */
+ /* [enc type]+"CUESHEET\0" = 10 */
unsigned char cuesheet_offset = 10;
switch (tag[0]) {
case 0x00:
@@ -1008,11 +1008,13 @@ void setid3v2title(int fd, struct mp3entry *entry)
break;
case 0x01:
char_enc = CHAR_ENC_UTF_16_LE;
- cuesheet_offset += cuesheet_offset+1;
+ /* \1 + \xff\xfe + C\0U\0E\0S\0H\0E\0E\0T\0\0\0 = 21 */
+ cuesheet_offset = 21;
break;
case 0x02:
char_enc = CHAR_ENC_UTF_16_BE;
- cuesheet_offset += cuesheet_offset+1;
+ /* \2 + \xfe\xff + \0C\0U\0E\0S\0H\0E\0E\0T\0\0 = 21 */
+ cuesheet_offset = 21;
break;
case 0x03:
char_enc = CHAR_ENC_UTF_8;