Skip to content

Commit 10561f5

Browse files
committed
Fix broken KSY for albums (subtype missing)
Also switch to testing single bit for offset size
1 parent 7b61d41 commit 10561f5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main/kaitai/rekordbox_pdb.ksy

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,11 @@ types:
384384
doc: |
385385
A row that holds an album name and ID.
386386
seq:
387-
- type: u2
387+
- id: subtype
388+
type: u2
388389
doc: |
389-
Some kind of magic word? Usually 0x80, 0x00.
390+
Usually 0x80, but 0x84 means we have a long name offset
391+
embedded in the row.
390392
- id: index_shift
391393
type: u2
392394
doc: TODO name from @flesniak, but what does it mean?
@@ -417,9 +419,9 @@ types:
417419
For names that might be further than 0xff bytes from the
418420
start of this row, this holds a two-byte offset, and is
419421
signalled by the subtype value.
420-
if: subtype == 0x84
422+
if: subtype & 0x04 == 0x04
421423
name:
422-
pos: '_parent.row_base + (subtype == 0x84? ofs_name_far : ofs_name_near)'
424+
pos: '_parent.row_base + (subtype & 0x04 == 0x04? ofs_name_far : ofs_name_near)'
423425
type: device_sql_string
424426
doc: |
425427
The name of this album.
@@ -458,9 +460,9 @@ types:
458460
For names that might be further than 0xff bytes from the
459461
start of this row, this holds a two-byte offset, and is
460462
signalled by the subtype value.
461-
if: subtype == 0x64
463+
if: subtype & 0x04 == 0x04
462464
name:
463-
pos: '_parent.row_base + (subtype == 0x64? ofs_name_far : ofs_name_near)'
465+
pos: '_parent.row_base + (subtype & 0x04 == 0x04? ofs_name_far : ofs_name_near)'
464466
type: device_sql_string
465467
doc: |
466468
The name of this artist.

0 commit comments

Comments
 (0)