diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-01-22 18:47:35 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-01-22 18:47:35 +0000 |
commit | 8f1d3c944b509874be07a1f12387de37adf12626 (patch) | |
tree | 717ea932ac6f19f566eaff4187b87f87700bd114 /firmware/rolo.c | |
parent | 86352ccc3f47bc0f6bdcdcdc7b752f0836900fcd (diff) | |
download | rockbox-8f1d3c944b509874be07a1f12387de37adf12626.tar.gz rockbox-8f1d3c944b509874be07a1f12387de37adf12626.zip |
Ludovic Lange's patch to make the ROLO feature work on the FM Recorder.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3151 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/rolo.c')
-rw-r--r-- | firmware/rolo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c index 92c8cc4003..f8aad52546 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c | |||
@@ -68,8 +68,8 @@ int rolo_load(char* filename) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /* Read file length from header and compare to real file length */ | 70 | /* Read file length from header and compare to real file length */ |
71 | length=lseek(fd,0,SEEK_END)-6; | 71 | length=lseek(fd,0,SEEK_END)-FIRMWARE_OFFSET_FILE_DATA; |
72 | lseek(fd, 0, SEEK_SET); | 72 | lseek(fd, FIRMWARE_OFFSET_FILE_LENGTH, SEEK_SET); |
73 | if(read(fd, &file_length, 4) != 4) { | 73 | if(read(fd, &file_length, 4) != 4) { |
74 | rolo_error("Error Reading File Length"); | 74 | rolo_error("Error Reading File Length"); |
75 | return -1; | 75 | return -1; |
@@ -80,12 +80,12 @@ int rolo_load(char* filename) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | /* Read and save checksum */ | 82 | /* Read and save checksum */ |
83 | lseek(fd, 4, SEEK_SET); | 83 | lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET); |
84 | if (read(fd, &file_checksum, 2) != 2) { | 84 | if (read(fd, &file_checksum, 2) != 2) { |
85 | rolo_error("Error Reading checksum"); | 85 | rolo_error("Error Reading checksum"); |
86 | return -1; | 86 | return -1; |
87 | } | 87 | } |
88 | lseek(fd, 6, SEEK_SET); | 88 | lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET); |
89 | 89 | ||
90 | /* verify that file can be read and descrambled */ | 90 | /* verify that file can be read and descrambled */ |
91 | if ((&mp3buf[0] + (2*length)+4) >= &mp3end) { | 91 | if ((&mp3buf[0] + (2*length)+4) >= &mp3end) { |