diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/songdb.pl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl index 659457d554..dad7e10496 100755 --- a/tools/songdb.pl +++ b/tools/songdb.pl | |||
@@ -192,12 +192,12 @@ sub crc32 { | |||
192 | 192 | ||
193 | if(!$crc) { | 193 | if(!$crc) { |
194 | return 0; # fixed bad CRC when disabled! | 194 | return 0; # fixed bad CRC when disabled! |
195 | # better to set to 0 cause the rundb code will handle it better that way. | 195 | # The runtimedb treats a CRC zero as CRC disabled! |
196 | } | 196 | } |
197 | 197 | ||
198 | if(!open(FILE, "<$filename")) { | 198 | if(!open(FILE, "<$filename")) { |
199 | print "failed to open \"$filename\" $!\n"; | 199 | print "failed to open \"$filename\" $!\n"; |
200 | return -2; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | # read $data from index $index to $buffer from the file, may return fewer | 203 | # read $data from index $index to $buffer from the file, may return fewer |
@@ -266,8 +266,14 @@ sub crc32 { | |||
266 | # printf("%08x\n", $crc); | 266 | # printf("%08x\n", $crc); |
267 | } | 267 | } |
268 | 268 | ||
269 | return $crc; | 269 | if($crc == 0) { |
270 | # rule out the very small risk that this actually returns a zero, as | ||
271 | # the current rockbox code assumes a zero CRC means it is disabled! | ||
272 | # TODO: fix the Rockbox code. This is just a hack. | ||
273 | return 1; | ||
274 | } | ||
270 | 275 | ||
276 | return $crc; | ||
271 | } | 277 | } |
272 | 278 | ||
273 | sub singlefile { | 279 | sub singlefile { |